From e71c47ff54a11bf30143b6e9a1364a0f7873b5d9 Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Wed, 29 Jul 2020 13:47:51 +0200 Subject: [PATCH] fix: show saving status when editing note for the first time --- app/assets/javascripts/views/editor/editor_view.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/views/editor/editor_view.ts b/app/assets/javascripts/views/editor/editor_view.ts index ae49f057e..4214ba083 100644 --- a/app/assets/javascripts/views/editor/editor_view.ts +++ b/app/assets/javascripts/views/editor/editor_view.ts @@ -195,11 +195,15 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> { if (!this.editorValues.text) { this.editorValues.text = note.text; } - if (note.lastSyncBegan && note.lastSyncEnd) { - if (note.lastSyncBegan!.getTime() > note.lastSyncEnd!.getTime()) { - this.showSavingStatus() - } else if (note.lastSyncEnd!.getTime() > note.lastSyncBegan!.getTime()) { - this.showAllChangesSavedStatus(); + if (note.lastSyncBegan) { + if (note.lastSyncEnd) { + if (note.lastSyncBegan!.getTime() > note.lastSyncEnd!.getTime()) { + this.showSavingStatus() + } else if (note.lastSyncEnd!.getTime() > note.lastSyncBegan!.getTime()) { + this.showAllChangesSavedStatus(); + } + } else { + this.showSavingStatus(); } } });