Browse Source

fix useIsNotCreatable

Yuki Takei 6 months ago
parent
commit
240d202416
1 changed files with 2 additions and 1 deletions
  1. 2 1
      apps/app/src/states/page/hooks.ts

+ 2 - 1
apps/app/src/states/page/hooks.ts

@@ -102,8 +102,9 @@ export const useIsRevisionOutdated = (): boolean =>
  * Computed hook for checking if current page is creatable
  */
 export const useIsNotCreatable = (): boolean => {
+  const isNotFound = useAtomValue(pageNotFoundAtom);
   const pagePath = useCurrentPagePath();
-  return pagePath == null ? true : !isCreatablePage(pagePath);
+  return isNotFound && (pagePath == null ? true : !isCreatablePage(pagePath));
 };
 
 /**