Skip to content

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

fix: crashes in various places

thecodrrdfdf74a9b4e2
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 (
<Suspense fallback={<EditorLoading />}>
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;
+ }
+ );
}}
>
<TextWithTip
diff --git a/apps/web/yarn.lock b/apps/web/yarn.lock
index b1df35e2e..50d689676 100644
--- a/apps/web/yarn.lock
+++ b/apps/web/yarn.lock
@@ -8973,9 +8973,21 @@ normalize-url@^3.0.0, normalize-url@^3.0.1:
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559"
integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==
+notes-core@../notes-core:
+ version "5.2.0"
+ dependencies:
+ fast-sort "^2.0.1"
+ fuzzysearch "^1.0.3"
+ jshashes "^1.0.8"
+ no-internet "^1.5.2"
+ qclone "^1.0.4"
+ quill-delta-to-html "^0.12.0"
+ quill-delta-to-markdown "https://github.com/streetwriters/quill-delta-to-markdown"
+ transfun "^1.0.2"
+
"notes-core@git+ssh://[email protected]:streetwriters/notesnook-core.git":
- version "5.1.0"
- resolved "git+ssh://[email protected]:streetwriters/notesnook-core.git#9abccbc225808b435df55910b9e54f21a695ae6b"
+ version "5.2.0"
+ resolved "git+ssh://[email protected]:streetwriters/notesnook-core.git#6af45d70b085e39e74c414448649cbb04f68689e"
dependencies:
fast-sort "^2.0.1"
fuzzysearch "^1.0.3"