diff --git a/apps/web/src/components/spliteditor/simpleeditor.js b/apps/web/src/components/spliteditor/simpleeditor.js
index 61ef64149..b7c3b01d1 100644
--- a/apps/web/src/components/spliteditor/simpleeditor.js
+++ b/apps/web/src/components/spliteditor/simpleeditor.js
@@ -6,7 +6,7 @@ function SimpleEditor(props) {
const { delta, container, id, pref } = props;
useEffect(() => {
const toolbar = document.querySelector(`${container} .ql-toolbar.ql-snow`);
- toolbar.remove();
+ if (toolbar) toolbar.remove();
}, [container]);
return (
}>
diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js
index 1d0891015..d5954eef5 100644
--- a/apps/web/src/stores/editor-store.js
+++ b/apps/web/src/stores/editor-store.js
@@ -136,7 +136,7 @@ class EditorStore extends BaseStore {
saveLastOpenedNote(!this.get().session.locked && id);
- if (!oldSession.index) {
+ if (!oldSession?.index) {
setHashParam({ note: id }, false);
}
});
diff --git a/apps/web/src/views/settings.js b/apps/web/src/views/settings.js
index cf82663bb..8f4e860e9 100644
--- a/apps/web/src/views/settings.js
+++ b/apps/web/src/views/settings.js
@@ -223,9 +223,13 @@ function Settings(props) {
sx={{ borderColor: "error" }}
variant="list"
onClick={async () => {
- // if (await showAccountDeleteConfirmation(user.username)) {
- // await db.user.deleteUser();
- // }
+ return showPasswordDialog(
+ "delete_account",
+ async ({ password }) => {
+ await db.user.deleteUser(password);
+ return true;
+ }
+ );
}}
>