Explorar el Código

Mutate when revisionId changes

Shun Miyazawa hace 2 años
padre
commit
36a32731c1
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      apps/app/src/stores/page.tsx

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

@@ -80,6 +80,10 @@ export const useSWRxCurrentPage = (initialData?: IPagePopulatedToShowRevision|nu
       return true;
     }
 
+    if (cachedData.revision?._id !== initialData.revision?._id) {
+      return true;
+    }
+
     return false;
   })();