handle note updating and inserting

This commit is contained in:
tibbi
2018-11-07 19:57:30 +01:00
parent 99ee559836
commit 95ab889045
6 changed files with 36 additions and 31 deletions

View File

@ -188,8 +188,9 @@ class NoteFragment : androidx.fragment.app.Fragment() {
private fun saveNoteValue(note: Note) {
if (note.path.isEmpty()) {
db.updateNote(note)
(activity as MainActivity).noteSavedSuccessfully(note.title)
NotesHelper(activity!!).insertOrUpdateNote(note) {
(activity as MainActivity).noteSavedSuccessfully(note.title)
}
} else {
val currentText = getCurrentNoteViewText()
if (currentText != null) {