Procházet zdrojové kódy

fix the condition to mutate

Yuki Takei před 2 roky
rodič
revize
32ddba8674
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      apps/app/src/stores/page.tsx

+ 4 - 1
apps/app/src/stores/page.tsx

@@ -74,9 +74,12 @@ export const useSWRxCurrentPage = (initialData?: IPagePopulatedToShowRevision|nu
       return true;
     }
 
-    if (initialData.revision?._id !== cachedData?.revision?._id) {
+    // mutate when the empty page has updated
+    if (cachedData?.revision == null && initialData.revision != null) {
       return true;
     }
+
+    return false;
   })();
 
   useEffect(() => {