Note Edit: Immediately update that note in the list

Otherwise, it's only after syncing and reloading the entire list of
notes do we see the update. This process is usually quite fast, but
not always.
This commit is contained in:
Vishesh Handa
2019-02-14 23:44:49 +01:00
parent cc7774707f
commit 428c0bb611

View File

@ -189,6 +189,14 @@ class StateContainerState extends State<StateContainer> {
void updateNote(Note note) {
print("State Container updateNote");
setState(() {
// Update that specific note
for (var i = 0; i < appState.notes.length; i++) {
var n = appState.notes[i];
if (n.filePath == note.filePath) {
appState.notes[i] = note;
}
}
noteRepo.updateNote(note).then((NoteRepoResult _) {
_syncNotes();
});