fix: show saving status when editing note for the first time

This commit is contained in:
Baptiste Grob
2020-07-29 13:47:51 +02:00
parent d80c74b746
commit e71c47ff54

View File

@@ -195,12 +195,16 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
if (!this.editorValues.text) { if (!this.editorValues.text) {
this.editorValues.text = note.text; this.editorValues.text = note.text;
} }
if (note.lastSyncBegan && note.lastSyncEnd) { if (note.lastSyncBegan) {
if (note.lastSyncEnd) {
if (note.lastSyncBegan!.getTime() > note.lastSyncEnd!.getTime()) { if (note.lastSyncBegan!.getTime() > note.lastSyncEnd!.getTime()) {
this.showSavingStatus() this.showSavingStatus()
} else if (note.lastSyncEnd!.getTime() > note.lastSyncBegan!.getTime()) { } else if (note.lastSyncEnd!.getTime() > note.lastSyncBegan!.getTime()) {
this.showAllChangesSavedStatus(); this.showAllChangesSavedStatus();
} }
} else {
this.showSavingStatus();
}
} }
}); });
} }