Skip to content

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

feat: delete note toast

alihamuh874351637b04
diff --git a/apps/web/src/common/toasts.js b/apps/web/src/common/toasts.js
index b890a1aff..a480c0919 100644
--- a/apps/web/src/common/toasts.js
+++ b/apps/web/src/common/toasts.js
@@ -29,8 +29,14 @@ function showNotesMovedToast(note, noteIds, notebook) {
}
function showNoteDeleted(note) {
- const undoAction = async () => {
- await db.trash.restore(note);
+ const undoAction = () => {
+ let deletedNotes = db.trash.all;
+ deletedNotes.forEach((element) => {
+ if (element.itemId === note) {
+ db.trash.restore(element.id);
+ notestore.refresh();
+ }
+ });
};
let actions = [{ text: "Undo", onClick: undoAction }];