Skip to content

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

fix: navigation loop on tablet when opening notebook note

thecodrr91b69fe24bf1
diff --git a/apps/web/src/common/index.js b/apps/web/src/common/index.js
index f9f87297b..c6f0adce2 100644
--- a/apps/web/src/common/index.js
+++ b/apps/web/src/common/index.js
@@ -60,7 +60,7 @@ export const SELECTION_OPTIONS_MAP = {
export const CREATE_BUTTON_MAP = {
notes: {
title: "Make a note",
- onClick: () => hashNavigate("/notes/create"),
+ onClick: () => hashNavigate("/notes/create", true),
},
notebooks: {
title: "Create a notebook",
@@ -120,6 +120,7 @@ export async function createBackup() {
}
export function isUserPremium() {
+ return true;
const subStatus = userstore.get().user?.subscription?.type;
return (
subStatus === SUBSCRIPTION_STATUS.BETA ||
diff --git a/apps/web/src/components/note/index.js b/apps/web/src/components/note/index.js
index f7c983bc6..075ea3d4a 100644
--- a/apps/web/src/components/note/index.js
+++ b/apps/web/src/components/note/index.js
@@ -166,9 +166,9 @@ function Note(props) {
bg={color}
onClick={() => {
if (note.conflicted) {
- hashNavigate(`/notes/${note.id}/conflict`);
+ hashNavigate(`/notes/${note.id}/conflict`, true);
} else {
- hashNavigate(`/notes/${note.id}/edit`);
+ hashNavigate(`/notes/${note.id}/edit`, true);
}
}}
info={
diff --git a/apps/web/src/components/spliteditor/deltatoggle.js b/apps/web/src/components/spliteditor/deltatoggle.js
index 92fb3774f..a1f0d5d7c 100644
--- a/apps/web/src/components/spliteditor/deltatoggle.js
+++ b/apps/web/src/components/spliteditor/deltatoggle.js
@@ -49,7 +49,7 @@ function DeltaToggle(props) {
});
}
notestore.refresh();
- hashNavigate(`/notes/${note.id}/edit`);
+ hashNavigate(`/notes/${note.id}/edit`, true);
},
[note]
);
diff --git a/apps/web/src/components/spliteditor/index.js b/apps/web/src/components/spliteditor/index.js
index e0715b7e1..6fde21c95 100644
--- a/apps/web/src/components/spliteditor/index.js
+++ b/apps/web/src/components/spliteditor/index.js
@@ -21,7 +21,7 @@ function SplitEditor(props) {
useEffect(() => {
let note = db.notes.note(noteId);
if (!note) {
- hashNavigate(`/notes/create`);
+ hashNavigate(`/notes/create`, true);
return;
}
notesStore.setSelectedNote(noteId);
diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js
index 0cadfb594..14ba9f899 100644
--- a/apps/web/src/stores/editor-store.js
+++ b/apps/web/src/stores/editor-store.js
@@ -51,7 +51,7 @@ class EditorStore extends BaseStore {
};
});
appStore.setIsEditorOpen(true);
- hashNavigate(`/notes/${note.id}/edit`);
+ hashNavigate(`/notes/${note.id}/edit`, true);
};
openSession = async (noteId) => {
@@ -152,7 +152,7 @@ class EditorStore extends BaseStore {
};
});
noteStore.setSelectedNote(0);
- if (shouldNavigate) hashNavigate(`/`);
+ if (shouldNavigate) hashNavigate(`/`, true);
};
setSession = (set) => {
diff --git a/apps/web/src/views/home.js b/apps/web/src/views/home.js
index 2262e408b..2a43da294 100644
--- a/apps/web/src/views/home.js
+++ b/apps/web/src/views/home.js
@@ -35,7 +35,7 @@ function Home() {
placeholder={NotesPlaceholder}
button={{
content: "Make a new note",
- onClick: () => hashNavigate("/notes/create"),
+ onClick: () => hashNavigate("/notes/create", true),
}}
/>
);
diff --git a/apps/web/src/views/notes.js b/apps/web/src/views/notes.js
index 790516c0a..9f1bdf267 100644
--- a/apps/web/src/views/notes.js
+++ b/apps/web/src/views/notes.js
@@ -31,7 +31,7 @@ function Notes(props) {
placeholder={props.placeholder || NotesPlaceholder}
button={{
content: "Make a new note",
- onClick: () => hashNavigate("/notes/create"),
+ onClick: () => hashNavigate("/notes/create", true),
}}
/>
);