1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 18:03:48 +00:00
This commit is contained in:
王健辉
2019-04-26 15:34:22 +08:00
parent 5e9785e3fc
commit a51fdb51c7

View File

@@ -113,7 +113,6 @@ class FileHistory extends React.Component {
}); });
editUtilties.listFileHistoryRecords(filePath, currentPage, PER_PAGE).then(res => { editUtilties.listFileHistoryRecords(filePath, currentPage, PER_PAGE).then(res => {
this.updateNewRecords(res.data); this.updateNewRecords(res.data);
this.setState({isReloadingData: false});
}); });
} else { } else {
let commitID = this.state.nextCommit; let commitID = this.state.nextCommit;
@@ -123,12 +122,10 @@ class FileHistory extends React.Component {
if (oldFilePath) { if (oldFilePath) {
seafileAPI.listOldFileHistoryRecords(historyRepoID, oldFilePath, commitID).then((res) => { seafileAPI.listOldFileHistoryRecords(historyRepoID, oldFilePath, commitID).then((res) => {
this.updateOldRecords(res.data, oldFilePath); this.updateOldRecords(res.data, oldFilePath);
this.setState({isReloadingData: false});
}); });
} else { } else {
seafileAPI.listOldFileHistoryRecords(historyRepoID, filePath, commitID).then((res) => { seafileAPI.listOldFileHistoryRecords(historyRepoID, filePath, commitID).then((res) => {
this.updateOldRecords(res.data, filePath); this.updateOldRecords(res.data, filePath);
this.setState({isReloadingData: false});
}); });
} }
} }
@@ -140,7 +137,7 @@ class FileHistory extends React.Component {
historyList: [...this.state.historyList, ...result.data], historyList: [...this.state.historyList, ...result.data],
currentPage: result.page, currentPage: result.page,
hasMore: result.total_count > (PER_PAGE * this.state.currentPage), hasMore: result.total_count > (PER_PAGE * this.state.currentPage),
isLoading: false, isReloadingData: false,
}); });
} }
@@ -151,7 +148,7 @@ class FileHistory extends React.Component {
nextCommit: result.next_start_commit, nextCommit: result.next_start_commit,
filePath: result.data[result.data.length-1].path, filePath: result.data[result.data.length-1].path,
oldFilePath: result.data[result.data.length-1].rev_renamed_old_path, oldFilePath: result.data[result.data.length-1].rev_renamed_old_path,
isLoading: false, isReloadingData: false,
}); });
} else { } else {
this.setState({nextCommit: result.next_start_commit,}); this.setState({nextCommit: result.next_start_commit,});