소스 검색

Mutate when revision switches

Shun Miyazawa 1 년 전
부모
커밋
9b31380644
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      apps/app/src/stores/page.tsx

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

@@ -81,6 +81,11 @@ export const useSWRxCurrentPage = (initialData?: IPagePopulatedToShowRevision|nu
       return true;
     }
 
+    // mutate When a different revision is opened
+    if (cachedData.revision?._id != null && initialData.revision?._id != null && cachedData.revision._id !== initialData.revision._id) {
+      return true;
+    }
+
     return false;
   })();