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

This commit is contained in:
Abdullah Atta
2024-03-07 15:00:13 +05:00
parent ce53495b76
commit ce4e0a1916

View File

@@ -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);
},