Skip to content

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

fix: trash item not cleared on permanent delete

thecodrr99d22e846082
diff --git a/apps/web/src/stores/trash-store.js b/apps/web/src/stores/trash-store.js
index cb1086f07..3df988238 100644
--- a/apps/web/src/stores/trash-store.js
+++ b/apps/web/src/stores/trash-store.js
@@ -12,7 +12,10 @@ class TrashStore extends BaseStore {
delete = (id, commit = false) => {
if (!commit) {
- return this.set((state) => (state.trash = db.trash.all));
+ return this.set((state) => {
+ const index = state.trash.findIndex((item) => item.id === id);
+ if (index > -1) state.trash.splice(index, 1);
+ });
}
return db.trash.delete(id);
};