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

Merge pull request #9296 from weseek/fix/show-old-revision

fix: Couln't show old revision
mergify[bot] 1 год назад
Родитель
Сommit
d27db0edaa
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      apps/app/src/stores/page.tsx

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

@@ -139,7 +139,14 @@ export const useSWRMUTxCurrentPage = (): SWRMutationResponse<IPagePopulatedToSho
   return useSWRMutation(
     key,
     () => apiv3Get<{ page: IPagePopulatedToShowRevision }>('/page', { pageId: currentPageId, shareLinkId, revisionId })
-      .then(result => result.data.page)
+      .then((result) => {
+        const newData = result.data.page;
+
+        // for the issue https://redmine.weseek.co.jp/issues/156150
+        mutate('currentPage', newData, false);
+
+        return newData;
+      })
       .catch(getPageApiErrorHandler),
     {
       populateCache: true,