From 57ddeb3e0952303df195b6ae18e43735e6f86efc Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Mon, 5 Apr 2021 07:27:32 -0500 Subject: [PATCH] feat: show offline status in saving indicator (#539) Co-authored-by: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> --- app/assets/javascripts/views/editor/editor_view.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/views/editor/editor_view.ts b/app/assets/javascripts/views/editor/editor_view.ts index c99bb0991..96aa4fc04 100644 --- a/app/assets/javascripts/views/editor/editor_view.ts +++ b/app/assets/javascripts/views/editor/editor_view.ts @@ -54,7 +54,7 @@ const ElementIds = { type NoteStatus = { message?: string; - date?: Date; + desc?: string; }; type EditorState = { @@ -541,11 +541,11 @@ class EditorViewCtrl extends PureViewCtrl { syncTakingTooLong: false, }); this.setStatus({ - message: 'All changes saved', + message: 'All changes saved' + (this.application.noAccount() ? ' offline' : ''), }); } - showErrorStatus(error?: any) { + showErrorStatus(error?: NoteStatus) { if (!error) { error = { message: 'Sync Unreachable', @@ -559,7 +559,7 @@ class EditorViewCtrl extends PureViewCtrl { this.setStatus(error); } - setStatus(status: { message: string }, wait = true) { + setStatus(status: NoteStatus, wait = true) { if (this.statusTimeout) { this.$timeout.cancel(this.statusTimeout); }