mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
fix sync status
This commit is contained in:
@@ -126,27 +126,29 @@ export default class SyncStatusWidget extends BasicWidget {
|
||||
});
|
||||
|
||||
this.syncState = 'in-progress';
|
||||
this.allChangesPushed = false;
|
||||
this.lastSyncedPush = message.lastSyncedPush;
|
||||
}
|
||||
else if (message.type === 'sync-push-in-progress') {
|
||||
this.syncState = 'in-progress';
|
||||
this.allChangesPushed = false;
|
||||
this.lastSyncedPush = message.lastSyncedPush;
|
||||
}
|
||||
else if (message.type === 'sync-finished') {
|
||||
// this gives user a chance to see the toast in case of fast sync finish
|
||||
setTimeout(() => toastService.closePersistent('sync'), 1000);
|
||||
|
||||
this.syncState = 'connected';
|
||||
this.lastSyncedPush = message.lastSyncedPush;
|
||||
}
|
||||
else if (message.type === 'sync-failed') {
|
||||
this.syncState = 'disconnected';
|
||||
this.lastSyncedPush = message.lastSyncedPush;
|
||||
}
|
||||
else if (message.type === 'frontend-update') {
|
||||
const {lastSyncedPush} = message.data;
|
||||
|
||||
this.allChangesPushed = lastSyncedPush === ws.getMaxKnownEntityChangeSyncId();
|
||||
this.lastSyncedPush = message.data.lastSyncedPush;
|
||||
}
|
||||
|
||||
this.allChangesPushed = this.lastSyncedPush === ws.getMaxKnownEntityChangeSyncId();
|
||||
|
||||
if (['unknown', 'in-progress'].includes(this.syncState)) {
|
||||
this.showIcon(this.syncState);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user