Skip to content

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

web: add support for `/notes/:noteId/edit` hash route

Abdullah Attace4e0a1916cd
diff --git a/apps/web/src/navigation/hash-routes.tsx b/apps/web/src/navigation/hash-routes.tsx
index 63cc78034..47bc3a2b8 100644
--- a/apps/web/src/navigation/hash-routes.tsx
+++ b/apps/web/src/navigation/hash-routes.tsx
@@ -33,6 +33,7 @@ import {
} from "../common/dialog-controller";
import { hashNavigate } from ".";
import { defineRoutes } from "./types";
+import { useEditorStore } from "../stores/editor-store";
const hashroutes = defineRoutes({
"/": () => {
@@ -56,47 +57,9 @@ const hashroutes = defineRoutes({
"/tags/create": () => {
showCreateTagDialog().then(afterAction);
},
- // "/notes/create": () => {
- // closeOpenedDialog();
- // editorStore.get().newSession();
- // // hashNavigate("/notes/create", { addNonce: true, replace: true });
- // },
- // "/notes/create/:nonce": ({ nonce }) => {
- // closeOpenedDialog();
- // // return <Editor nonce={nonce} />;
- // },
- // "/notes/:noteId/edit": ({ noteId }) => {
- // closeOpenedDialog();
- // editorStore.get().openSession(noteId);
- // // return <Editor noteId={noteId} />;
- // },
- // "/notes/:noteId/unlock": ({ noteId }) => {
- // closeOpenedDialog();
- // editorStore.get().openSession(noteId);
- // // return (
- // // <RouteContainer
- // // type="unlock"
- // // buttons={{
- // // back: isMobile()
- // // ? {
- // // title: "Go back",
- // // onClick: () =>
- // // hashNavigate("/notes/create", {
- // // addNonce: true,
- // // replace: true
- // // })
- // // }
- // // : undefined
- // // }}
- // // >
- // // <Unlock noteId={noteId} />
- // // </RouteContainer>
- // // );
- // },
- // "/notes/:noteId/conflict": ({ noteId }) => {
- // closeOpenedDialog();
- // return <DiffViewer noteId={noteId} />;
- // },
+ "/notes/:noteId/edit": ({ noteId }) => {
+ useEditorStore.getState().openSession(noteId);
+ },
"/buy": () => {
showBuyDialog().then(afterAction);
},