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

get the value (revisionIdFromUrlAtom) when the function is executed.

Shun Miyazawa 3 месяцев назад
Родитель
Сommit
62ca295978
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      apps/app/src/states/page/use-fetch-current-page.ts

+ 2 - 2
apps/app/src/states/page/use-fetch-current-page.ts

@@ -177,7 +177,6 @@ export const useFetchCurrentPage = (): {
   error: Error | null;
 } => {
   const shareLinkId = useAtomValue(shareLinkIdAtom);
-  const revisionIdFromUrl = useAtomValue(revisionIdFromUrlAtom);
   const currentPageId = useAtomValue(currentPageIdAtom);
 
   const isLoading = useAtomValue(pageLoadingAtom);
@@ -197,6 +196,7 @@ export const useFetchCurrentPage = (): {
       ): Promise<IPagePopulatedToShowRevision | null> => {
         const currentPageId = get(currentPageIdAtom);
         const currentPageData = get(currentPageDataAtom);
+        const revisionIdFromUrl = get(revisionIdFromUrlAtom);
 
         // Process path first to handle permalinks and strip hash fragments
         const decodedPathname = decodeAndRemoveFragment(args?.path);
@@ -270,7 +270,7 @@ export const useFetchCurrentPage = (): {
 
         return null;
       },
-      [shareLinkId, revisionIdFromUrl, mutatePageInfo],
+      [shareLinkId, mutatePageInfo],
     ),
   );