Przeglądaj źródła

refact null check

yuken 4 lat temu
rodzic
commit
152ed267f2
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      packages/app/src/stores/page.tsx

+ 1 - 1
packages/app/src/stores/page.tsx

@@ -17,7 +17,7 @@ import { ITermNumberManagerUtil, useTermNumberManager } from './use-static-swr';
 
 
 export const useSWRxPageByPath = (path: string | null, initialData?: IPageHasId): SWRResponse<IPageHasId, Error> => {
 export const useSWRxPageByPath = (path: string | null, initialData?: IPageHasId): SWRResponse<IPageHasId, Error> => {
   return useSWR(
   return useSWR(
-    path ? ['/page', path] : null,
+    path != null ? ['/page', path] : null,
     (endpoint, path) => apiv3Get(endpoint, { path }).then(result => result.data.page),
     (endpoint, path) => apiv3Get(endpoint, { path }).then(result => result.data.page),
     {
     {
       fallbackData: initialData,
       fallbackData: initialData,