Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: rebuild trash cache on sync complete

Abdullah Atta4a1a912d0ff4
diff --git a/packages/core/src/api/sync/index.ts b/packages/core/src/api/sync/index.ts
index cf523a4e3..4d5dbf537 100644
--- a/packages/core/src/api/sync/index.ts
+++ b/packages/core/src/api/sync/index.ts
@@ -266,8 +266,10 @@ class Sync {
}
async stop() {
- // refresh monographs on sync completed
+ // refresh monographs
await this.db.monographs.refresh();
+ // update trash cache
+ await this.db.trash.buildCache();
this.logger.info("Stopping sync");
await this.db.setLastSynced(Date.now());
@@ -299,7 +301,6 @@ class Sync {
* @private
*/
async onPushCompleted() {
- console.log("PUSH COMPLETED!");
this.db.eventManager.publish(EVENTS.databaseSyncRequested, true, false);
}