feat: show offline status in saving indicator (#539)
Co-authored-by: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com>
This commit is contained in:
@@ -54,7 +54,7 @@ const ElementIds = {
|
|||||||
|
|
||||||
type NoteStatus = {
|
type NoteStatus = {
|
||||||
message?: string;
|
message?: string;
|
||||||
date?: Date;
|
desc?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type EditorState = {
|
type EditorState = {
|
||||||
@@ -541,11 +541,11 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
|||||||
syncTakingTooLong: false,
|
syncTakingTooLong: false,
|
||||||
});
|
});
|
||||||
this.setStatus({
|
this.setStatus({
|
||||||
message: 'All changes saved',
|
message: 'All changes saved' + (this.application.noAccount() ? ' offline' : ''),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
showErrorStatus(error?: any) {
|
showErrorStatus(error?: NoteStatus) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
error = {
|
error = {
|
||||||
message: 'Sync Unreachable',
|
message: 'Sync Unreachable',
|
||||||
@@ -559,7 +559,7 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
|||||||
this.setStatus(error);
|
this.setStatus(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
setStatus(status: { message: string }, wait = true) {
|
setStatus(status: NoteStatus, wait = true) {
|
||||||
if (this.statusTimeout) {
|
if (this.statusTimeout) {
|
||||||
this.$timeout.cancel(this.statusTimeout);
|
this.$timeout.cancel(this.statusTimeout);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user