Skip to content

Commit

Permalink
fix(todo-list): todo list not getting updated on note save
Browse files Browse the repository at this point in the history
  • Loading branch information
logickoder committed Nov 3, 2023
1 parent 91c7a2c commit 185af67
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,7 @@ class AddEditViewModel @Inject constructor(
}
}
}
fun updateReminderDateTime(dateTime: LocalDateTime?) {
_note.update {
it.copy(
reminderDateTime = dateTime,
isReminded = false
)
}
}

fun updateNote(
title: String,
description: String,
Expand Down Expand Up @@ -142,7 +135,8 @@ class AddEditViewModel @Inject constructor(
newNote.copy(
title = title,
note = description,
dateTime = Date()
dateTime = Date(),
checklist = checklist
// if the image has not been modified, use the old image uri
// image = if (oldNote.image == newNote.image) {
// oldNote.image
Expand All @@ -163,4 +157,13 @@ class AddEditViewModel @Inject constructor(
onSuccess(true)
}
}

fun updateReminderDateTime(dateTime: LocalDateTime?) {
_note.update {
it.copy(
reminderDateTime = dateTime,
isReminded = false
)
}
}
}

0 comments on commit 185af67

Please sign in to comment.