mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fix: clear sync queue on finish
This commit is contained in:
@@ -230,7 +230,7 @@ class Sync {
|
|||||||
|
|
||||||
arrays.types.push(type);
|
arrays.types.push(type);
|
||||||
arrays.items.push(JSON.stringify(item));
|
arrays.items.push(JSON.stringify(item));
|
||||||
arrays.ids.push(itemId);
|
arrays.ids.push(id);
|
||||||
|
|
||||||
return arrays;
|
return arrays;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,10 +33,11 @@ export class SyncQueue {
|
|||||||
const { itemIds } = syncQueue;
|
const { itemIds } = syncQueue;
|
||||||
for (let id of ids) {
|
for (let id of ids) {
|
||||||
const index = itemIds.findIndex((i) => i === id);
|
const index = itemIds.findIndex((i) => i === id);
|
||||||
if (index <= -1) return;
|
if (index <= -1) continue;
|
||||||
syncQueue.itemIds.splice(index, 1);
|
syncQueue.itemIds.splice(index, 1);
|
||||||
}
|
}
|
||||||
await this.save(syncQueue);
|
if (syncQueue.itemIds.length <= 0) await this.save(null);
|
||||||
|
else await this.save(syncQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user