mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 09:47:35 +08:00
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:
@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user