Taichi Masuyama 4 лет назад
Родитель
Сommit
ce6d4453dd
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      packages/app/src/stores/ui.tsx

+ 3 - 3
packages/app/src/stores/ui.tsx

@@ -269,14 +269,14 @@ export const useCreateModalOpened = (): SWRResponse<boolean, Error> => {
   );
 };
 
-export const useCreateModalPath = (): SWRResponse<Nullable<string | undefined>, Error> => {
+export const useCreateModalPath = (): SWRResponse<string, Error> => {
   const { data: currentPagePath } = useCurrentPagePath();
   const { data: status } = useCreateModalStatus();
 
   return useSWR(
-    [currentPagePath, status],
+    currentPagePath != null && status != null ? [currentPagePath, status] : null,
     (currentPagePath, status) => {
-      return status?.path || currentPagePath;
+      return status.path || currentPagePath;
     },
   );
 };