From f50084dc1bbb8c607b494e3c9e933cba83b557f3 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 26 Jul 2021 21:28:45 +0200 Subject: [PATCH] removed annoying "sync update in progress" toast message --- src/public/app/widgets/note_tree.js | 2 +- src/public/app/widgets/sync_status.js | 10 ---------- src/routes/api/sync.js | 4 ++++ 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index a36fa4158..b95d9453d 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -454,7 +454,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { return; } - const note = await froca.getNote(node.data.noteId); + const note = await froca.getNote(node.data.noteId, true); if (!note || note.isDeleted) { return; diff --git a/src/public/app/widgets/sync_status.js b/src/public/app/widgets/sync_status.js index 15ab77fff..6739198e5 100644 --- a/src/public/app/widgets/sync_status.js +++ b/src/public/app/widgets/sync_status.js @@ -111,13 +111,6 @@ export default class SyncStatusWidget extends BasicWidget { processMessage(message) { if (message.type === 'sync-pull-in-progress') { - toastService.showPersistent({ - id: 'sync', - title: "Sync status", - message: "Sync update in progress", - icon: "refresh" - }); - this.syncState = 'in-progress'; this.lastSyncedPush = message.lastSyncedPush; } @@ -126,9 +119,6 @@ export default class SyncStatusWidget extends BasicWidget { 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; } diff --git a/src/routes/api/sync.js b/src/routes/api/sync.js index 4aaef2d58..c927103e3 100644 --- a/src/routes/api/sync.js +++ b/src/routes/api/sync.js @@ -11,6 +11,7 @@ const log = require('../../services/log'); const syncOptions = require('../../services/sync_options'); const dateUtils = require('../../services/date_utils'); const utils = require('../../services/utils'); +const ws = require('../../services/ws'); async function testSync() { try { @@ -60,6 +61,9 @@ function checkSync() { function syncNow() { log.info("Received request to trigger sync now."); + // when explicitly asked for set in progress status immediatelly for faster user feedback + ws.syncPullInProgress(); + return syncService.sync(); }