Skip to content

Commit 26ed93e

Browse files
committed
adding some widget handling related improvements
1 parent 87d1fba commit 26ed93e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/WidgetConfigureActivity.kt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,22 @@ class WidgetConfigureActivity : SimpleActivity() {
101101
NotesHelper(this).getNotes {
102102
mNotes = it
103103
notes_picker_holder.beVisibleIf(mNotes.size > 1 && !mIsCustomizingColors)
104-
val note = mNotes.firstOrNull { !it.isLocked() } ?: return@getNotes
105-
updateCurrentNote(note)
104+
var note = mNotes.firstOrNull { !it.isLocked() }
105+
106+
if (mNotes.size == 1 && note == null) {
107+
note = mNotes.first()
108+
SecurityDialog(this, note.protectionHash, note.protectionType) { hash, type, success ->
109+
if (success) {
110+
updateCurrentNote(note)
111+
} else {
112+
finish()
113+
}
114+
}
115+
} else {
116+
if (note != null) {
117+
updateCurrentNote(note)
118+
}
119+
}
106120
}
107121
}
108122

0 commit comments

Comments
 (0)