Explorar o código

fix useIsNotCreatable

Yuki Takei hai 8 meses
pai
achega
240d202416
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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));
 };
 
 /**