Skip to content

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

core: add method to rebuild trash cache

Abdullah Attab00110713544
diff --git a/packages/core/src/collections/trash.ts b/packages/core/src/collections/trash.ts
index 6efb5dbfb..81f283602 100644
--- a/packages/core/src/collections/trash.ts
+++ b/packages/core/src/collections/trash.ts
@@ -38,6 +38,13 @@ export default class Trash {
async init() {
await this.cleanup();
+ await this.buildCache();
+ }
+
+ async buildCache() {
+ this.cache.notes = [];
+ this.cache.notebooks = [];
+
const result = await this.db
.sql()
.selectFrom("notes")