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
feat: re-enable trash auto cleanup after 7 days
thecodrrbb41b8c9cbe5
diff --git a/packages/core/api/index.js b/packages/core/api/index.jsindex 7303c3e7b..583fca928 100644--- a/packages/core/api/index.js+++ b/packages/core/api/index.js@@ -83,6 +83,7 @@ class Database {this.trash = new Trash(this);+ await this.trash.cleanup();await this.settings.init();await this.outbox.init();await this.user.init();diff --git a/packages/core/collections/trash.js b/packages/core/collections/trash.jsindex 89d136794..4d70ddc3b 100644--- a/packages/core/collections/trash.js+++ b/packages/core/collections/trash.js@@ -19,14 +19,18 @@ export default class Trash {// await this.cleanup();// }- // async cleanup() {- // const sevenDayPreviousTimestamp = Date.now() - get7DayTimestamp();- // this.all.forEach(async (item) => {- // if (item.dateDeleted < sevenDayPreviousTimestamp) {- // await this.delete(item.id);- // }- // });- // }+ async init() {+ await this.cleanup();+ }++ async cleanup() {+ const sevenDayPreviousTimestamp = Date.now() - get7DayTimestamp();+ this.all.forEach(async (item) => {+ if (item.dateDeleted < sevenDayPreviousTimestamp) {+ await this.delete(item.id);+ }+ });+ }get all() {let trashItems = [];