Skip to content

Commit

Permalink
feat: show offline status in saving indicator (#539)
Browse files Browse the repository at this point in the history
Co-authored-by: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com>
  • Loading branch information
Mo Bitar and arielsvg authored Apr 5, 2021
1 parent 54486e4 commit 57ddeb3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/assets/javascripts/views/editor/editor_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const ElementIds = {

type NoteStatus = {
message?: string;
date?: Date;
desc?: string;
};

type EditorState = {
Expand Down Expand Up @@ -541,11 +541,11 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
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',
Expand All @@ -559,7 +559,7 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
this.setStatus(error);
}

setStatus(status: { message: string }, wait = true) {
setStatus(status: NoteStatus, wait = true) {
if (this.statusTimeout) {
this.$timeout.cancel(this.statusTimeout);
}
Expand Down

0 comments on commit 57ddeb3

Please sign in to comment.