فهرست منبع

Use useHasYjsDraft()

Shun Miyazawa 2 سال پیش
والد
کامیت
47fb469de5
1فایلهای تغییر یافته به همراه2 افزوده شده و 4 حذف شده
  1. 2 4
      apps/app/src/components/Navbar/PageEditorModeManager.tsx

+ 2 - 4
apps/app/src/components/Navbar/PageEditorModeManager.tsx

@@ -6,7 +6,7 @@ import { useTranslation } from 'next-i18next';
 
 import { useCreatePageAndTransit } from '~/client/services/create-page';
 import { toastError } from '~/client/util/toastr';
-import { useIsNotFound } from '~/stores/page';
+import { useIsNotFound, useHasYjsDraft } from '~/stores/page';
 import { EditorMode, useEditorMode, useIsDeviceLargerThanMd } from '~/stores/ui';
 
 import { shouldCreateWipPage } from '../../utils/should-create-wip-page';
@@ -65,12 +65,10 @@ export const PageEditorModeManager = (props: Props): JSX.Element => {
   const { data: isNotFound } = useIsNotFound();
   const { mutate: mutateEditorMode } = useEditorMode();
   const { data: isDeviceLargerThanMd } = useIsDeviceLargerThanMd();
+  const { data: hasYjsDraft } = useHasYjsDraft();
 
   const { isCreating, createAndTransit } = useCreatePageAndTransit();
 
-  // TODO: https://redmine.weseek.co.jp/issues/132775
-  const hasYjsDraft = true;
-
   const editButtonClickedHandler = useCallback(async() => {
     if (isNotFound == null || isNotFound === false) {
       mutateEditorMode(EditorMode.Editor);