Skip to content

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

Merge branch 'master' of https://github.com/streetwriters/notesnook-web

alihamuh33fb5e356733
diff --cc apps/web/src/common/toasts.js
index 700aa8db2,36d4bab58..b890a1aff
--- a/apps/web/src/common/toasts.js
+++ b/apps/web/src/common/toasts.js
@@@ -23,25 -25,17 +25,40 @@@ function showNotesMovedToast(note, note
};
actions = [{ text: "Undo", onClick: undoAction }];
}
- showToast("success", messageText, actions);
+ var toast = showToast("success", messageText, actions);
}
+function showNoteDeleted(note) {
+ const undoAction = async () => {
+ await db.trash.restore(note);
+ };
+
+ let actions = [{ text: "Undo", onClick: undoAction }];
+
+ showToast("success", "Note Deleted", actions);
+}
+
+function showNoteColored(colors, label) {
+ if (colors.includes(label)) {
+ showToast("success", "Untagged as " + label);
+ } else {
+ showToast("success", "Tagged as " + label);
+ }
+}
+
- export { showNotesMovedToast, showNoteDeleted, showNoteColored };
+ async function showNoteUnpinnedToast(noteId) {
+ const messageText = `Note unpinned successfully!`;
+ const undoAction = async () => {
+ toast.hide();
+ await notestore.pin(noteId);
+ };
+ let actions = [{ text: "Undo", onClick: undoAction }];
+ var toast = showToast("success", messageText, actions);
+ }
+
-export { showNotesMovedToast, showNoteUnpinnedToast };
++export {
++ showNotesMovedToast,
++ showNoteDeleted,
++ showNoteColored,
++ showNoteUnpinnedToast,
++};
diff --cc apps/web/src/components/note/index.js
index d25fb5734,91c0185d4..ebb38f45f
--- a/apps/web/src/components/note/index.js
+++ b/apps/web/src/components/note/index.js
@@@ -13,7 -13,8 +13,9 @@@ import { useTheme } from "emotion-themi
import Colors from "../menu/colors";
import { showExportDialog } from "../dialogs/exportdialog";
import { setHashParam } from "../../utils/useHashParam";
+import { showNoteDeleted } from "../../common/toasts";
+ import { showToast } from "../../utils/toast";
+ import { showNoteUnpinnedToast } from "../../common/toasts";
function menuItems(note, context) {
return [