Просмотр исходного кода

Merge pull request #10515 from growilabs/fix/174327-editor-mode-shortcut-keys-not-working-2

fix: Editor mode shortcut keys not working
Yuki Takei 4 месяцев назад
Родитель
Сommit
6244d35bc1

+ 3 - 3
apps/app/src/client/components/Hotkeys/Subscribers/EditPage.jsx

@@ -7,7 +7,7 @@ import { EditorMode, useEditorMode } from '~/states/ui/editor';
 
 const EditPage = (props) => {
   const isEditable = useIsEditable();
-  const { mutate: mutateEditorMode } = useEditorMode();
+  const { setEditorMode } = useEditorMode();
 
   // setup effect
   useEffect(() => {
@@ -20,11 +20,11 @@ const EditPage = (props) => {
       return;
     }
 
-    mutateEditorMode(EditorMode.Editor);
+    setEditorMode(EditorMode.Editor);
 
     // remove this
     props.onDeleteRender(this);
-  }, [isEditable, mutateEditorMode, props]);
+  }, [isEditable, props, setEditorMode]);
 
   return null;
 };

+ 0 - 2
apps/app/src/client/components/PagePathNavSticky/PagePathNavSticky.tsx

@@ -29,8 +29,6 @@ export const PagePathNavSticky = (props: PagePathNavLayoutProps): JSX.Element =>
 
   const isPrinting = usePrintMode();
 
-  const isPrinting = usePrintMode();
-
   const pageControlsX = usePageControlsX();
   const [sidebarWidth] = useCurrentProductNavWidth();
   const { sidebarMode } = useSidebarMode();

+ 1 - 0
apps/app/src/components/PageView/PageViewLayout.tsx

@@ -1,5 +1,6 @@
 import type { JSX, ReactNode } from 'react';
 
+// biome-ignore lint/style/noRestrictedImports: ignore
 import { usePrintMode } from '~/client/services/use-print-mode';
 
 import styles from './PageViewLayout.module.scss';