Просмотр исходного кода

Revert "Do not fetch if pageId is undefined"

This reverts commit c66e6c3fb8a6853e1bdee30de16f27716f43c93b.
Shun Miyazawa 3 лет назад
Родитель
Сommit
bef9b342fd
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      packages/app/src/stores/page.tsx

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

@@ -81,8 +81,9 @@ export const useSWRxCurrentPage = (
 
 
 export const useSWRxTagsInfo = (pageId: Nullable<string>): SWRResponse<IPageTagsInfo | undefined, Error> => {
+
   const endpoint = `/pages.getPageTag?pageId=${pageId}`;
-  const key = pageId != null ? [endpoint, pageId] : null;
+  const key = [endpoint, pageId];
 
   const fetcher = async(endpoint: string, pageId: Nullable<string>) => {
     let tags: string[] = [];