Przeglądaj źródła

fix the condition to mutate

Yuki Takei 2 lat temu
rodzic
commit
32ddba8674
1 zmienionych plików z 4 dodań i 1 usunięć
  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;
       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 true;
     }
     }
+
+    return false;
   })();
   })();
 
 
   useEffect(() => {
   useEffect(() => {