A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: clear sync queue on finish
thecodrr854b45f8fc1a
diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.jsindex 2aac25db2..0cc410f0d 100644--- a/packages/core/api/sync/index.js+++ b/packages/core/api/sync/index.js@@ -230,7 +230,7 @@ class Sync {arrays.types.push(type);arrays.items.push(JSON.stringify(item));- arrays.ids.push(itemId);+ arrays.ids.push(id);return arrays;},diff --git a/packages/core/api/sync/sync-queue.js b/packages/core/api/sync/sync-queue.jsindex a0bb2db16..e812dcee3 100644--- a/packages/core/api/sync/sync-queue.js+++ b/packages/core/api/sync/sync-queue.js@@ -33,10 +33,11 @@ export class SyncQueue {const { itemIds } = syncQueue;for (let id of ids) {const index = itemIds.findIndex((i) => i === id);- if (index <= -1) return;+ if (index <= -1) continue;syncQueue.itemIds.splice(index, 1);}- await this.save(syncQueue);+ if (syncQueue.itemIds.length <= 0) await this.save(null);+ else await this.save(syncQueue);}/**