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: delete item from trash when restoring
thecodrr37acc7cac525
diff --git a/packages/core/__tests__/database.test.js b/packages/core/__tests__/database.test.jsindex ceb2816cd..39ea31786 100644--- a/packages/core/__tests__/database.test.js+++ b/packages/core/__tests__/database.test.js@@ -384,6 +384,8 @@ test("restore an item from trash", () =>let trash = db.getTrash();expect(trash.length).toBeGreaterThan(0);await db.restoreItem(timestamp);+ trash = db.getTrash();+ expect(trash.length).toBe(0);let notebook = db.getNotebook(timestamp);expect(notebook.dateCreated).toBe(timestamp);}));diff --git a/packages/core/api/database.js b/packages/core/api/database.jsindex 804decf49..255d08219 100644--- a/packages/core/api/database.js+++ b/packages/core/api/database.js@@ -426,6 +426,8 @@ class Database {delete this.trash[id].dType;let item = this.trash[id];this[type][id] = item;+ delete this.trash[id];+ await this.storage.write(KEYS.trash, this.trash);await this.storage.write(type, this[type]);}