A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: make back navigation in mobile editor work
thecodrrc3f5c8823318
diff --git a/apps/web/src/app.js b/apps/web/src/app.jsindex 5e58cc8a9..b335044c0 100644--- a/apps/web/src/app.js+++ b/apps/web/src/app.js@@ -22,6 +22,7 @@ function App() {const initUser = useUserStore((store) => store.init);const initNotes = useNotesStore((store) => store.init);const openLastSession = useEditorStore((store) => store.openLastSession);+ const sessionId = useEditorStore((store) => store.session.id);useEffect(() => {refreshColors();@@ -44,11 +45,9 @@ function App() {useEffect(() => {if (!isMobile()) return;- EditorNavigator.onNavigate = (route) => {- setShow(!!!route);- };+ setShow(!sessionId);// eslint-disable-next-line react-hooks/exhaustive-deps- }, []);+ }, [sessionId]);useEffect(() => {return () => {diff --git a/apps/web/src/components/editor/header.js b/apps/web/src/components/editor/header.jsindex ed5ef9943..8dc527864 100644--- a/apps/web/src/components/editor/header.js+++ b/apps/web/src/components/editor/header.js@@ -25,6 +25,7 @@ function Header() {const isSaving = useStore((store) => store.session.isSaving);const sessionState = useStore((store) => store.session.state);const setSession = useStore((store) => store.setSession);+ const newSession = useStore((store) => store.newSession);const isFocusMode = useAppStore((store) => store.isFocusMode);const toggleFocusMode = useAppStore((store) => store.toggleFocusMode);const toggleProperties = useStore((store) => store.toggleProperties);@@ -45,7 +46,7 @@ function Header() {display: ["block", "none", "none"],}}size={30}- onClick={() => EditorNavigator.navigate(null)}+ onClick={() => newSession()}/><TitleBoxshouldFocus={sessionState === SESSION_STATES.new}