Skip to content

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

feat: ask before deleting notebook

thecodrrbd8d3f43b5d0
diff --git a/apps/web/src/components/notebook/index.js b/apps/web/src/components/notebook/index.js
index f5fa450f0..d5dec0c49 100644
--- a/apps/web/src/components/notebook/index.js
+++ b/apps/web/src/components/notebook/index.js
@@ -2,7 +2,9 @@ import React from "react";
import { Flex, Text } from "rebass";
import ListItem from "../list-item";
import { store } from "../../stores/notebook-store";
+import * as Icon from "../icons";
import { showEditNoteDialog } from "../dialogs/addnotebookdialog";
+import { confirm } from "../dialogs/confirm";
function menuItems(notebook, index) {
return [
@@ -17,7 +19,17 @@ function menuItems(notebook, index) {
{
title: "Delete",
color: "red",
- onClick: () => store.delete(notebook.id, index),
+ onClick: () => {
+ confirm(
+ Icon.Trash,
+ "Delete Notebook",
+ "Are you sure you want to delete this notebook?"
+ ).then(async (res) => {
+ if (res) {
+ await store.delete(notebook.id, index);
+ }
+ });
+ },
},
];
}
diff --git a/apps/web/src/utils/css.js b/apps/web/src/utils/css.js
index 63c018294..376403a66 100644
--- a/apps/web/src/utils/css.js
+++ b/apps/web/src/utils/css.js
@@ -24,7 +24,6 @@ function getRootStylesheet() {
export function changeSvgTheme(newAccent) {
var nodes = document.querySelectorAll('*[fill="#0560ff"]');
- console.log(nodes);
for (var n = 0; n < nodes.length; ++n)
nodes[n].setAttribute("fill", newAccent);
}