Skip to content

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

feat: allow back button navigation from editor in phones

thecodrr666f06147c0a
diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js
index e2a6b2aeb..51973dfca 100644
--- a/apps/web/src/stores/editor-store.js
+++ b/apps/web/src/stores/editor-store.js
@@ -36,6 +36,11 @@ class EditorStore extends BaseStore {
init = () => {
window.addEventListener("hashchange", async () => {
const note = getHashParam("note");
+
+ if (isMobile() && !note && this.get().session.id) {
+ return this.clearSession();
+ }
+
if (note) await this.openSession(note);
});
};
@@ -147,7 +152,6 @@ class EditorStore extends BaseStore {
};
clearSession = () => {
- setHashParam({});
this.set(function (state) {
state.session = {
...DEFAULT_SESSION,
@@ -155,6 +159,7 @@ class EditorStore extends BaseStore {
});
saveLastOpenedNote();
noteStore.setSelectedNote(0);
+ setHashParam({});
};
setSession = (set) => {