mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-24 12:30:07 +01:00
adding an extra check to avoid deleting wrong notes
This commit is contained in:
parent
4c98d5201e
commit
e13926e6f5
@ -628,12 +628,12 @@ class MainActivity : SimpleActivity() {
|
||||
|
||||
private fun displayDeleteNotePrompt() {
|
||||
DeleteNoteDialog(this, mCurrentNote) {
|
||||
deleteNote(it)
|
||||
deleteNote(it, mCurrentNote)
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteNote(deleteFile: Boolean) {
|
||||
if (mNotes.size <= 1) {
|
||||
fun deleteNote(deleteFile: Boolean, note: Note) {
|
||||
if (mNotes.size <= 1 || note != mCurrentNote) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ class TextFragment : NoteFragment() {
|
||||
|
||||
val fileContents = note!!.getNoteStoredValue()
|
||||
if (fileContents == null) {
|
||||
(activity as MainActivity).deleteNote(false)
|
||||
(activity as MainActivity).deleteNote(false, note!!)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user