From 59b9445f489b64952c1b0665ee6dfeb063366218 Mon Sep 17 00:00:00 2001 From: Michael An <2331806369@qq.com> Date: Fri, 2 Aug 2024 18:03:20 +0800 Subject: [PATCH] fix sdoc history flash (#6481) --- .../src/pages/sdoc/sdoc-file-history/index.js | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/frontend/src/pages/sdoc/sdoc-file-history/index.js b/frontend/src/pages/sdoc/sdoc-file-history/index.js index 32a0631a47..bbebf5a8c0 100644 --- a/frontend/src/pages/sdoc/sdoc-file-history/index.js +++ b/frontend/src/pages/sdoc/sdoc-file-history/index.js @@ -125,7 +125,10 @@ class SdocFileHistory extends React.Component { }; onSelectHistoryVersion = (currentVersion, lastVersion) => { - this.setState({ isLoading: true, currentVersion }); + this.setState({ + currentVersion, + currentVersionContent: null, + }); seafileAPI.getFileRevision(historyRepoID, currentVersion.commit_id, currentVersion.path).then(res => { return seafileAPI.getFileContent(res.data); }).then(res => { @@ -139,7 +142,13 @@ class SdocFileHistory extends React.Component { }; setContent = (currentVersionContent = '', lastVersionContent = '') => { - this.setState({ currentVersionContent, lastVersionContent, isLoading: false, changes: [], currentDiffIndex: 0 }); + this.setState({ + currentVersionContent, + lastVersionContent, + isLoading: false, + changes: [], + currentDiffIndex: 0, + }); }; onShowChanges = (isShowChanges, lastVersion) => { @@ -381,11 +390,15 @@ class SdocFileHistory extends React.Component { ) : ( <> - + {currentVersionContent === null ? + + : + + } { showSidePanel && (