1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

repair code

This commit is contained in:
王健辉
2019-04-23 10:18:30 +08:00
parent 4cdc2d3e82
commit 02fa5933f2

View File

@@ -87,10 +87,21 @@ class FileHistory extends React.Component {
isError: false, isError: false,
fileOwner: result.data[0].creator_email, fileOwner: result.data[0].creator_email,
}); });
if (result.data.length < 25 && this.state.hasMore) { if (this.state.historyList.length < 25 && this.state.hasMore) {
this.reloadMore(); this.reloadMore();
} }
} }
} else {
this.setState({
nextCommit: result.next_start_commit,
isError: false,
});
if (this.state.nextCommit) {
seafileAPI.listOldFileHistoryRecords(historyRepoID, filePath, this.state.nextCommit).then((res) => {
this.setState({isReloadingData: false});
this.updateResultState(res.data);
});
}
} }
} }
@@ -159,18 +170,21 @@ class FileHistory extends React.Component {
isError: false, isError: false,
fileOwner: result.data[0].creator_email, fileOwner: result.data[0].creator_email,
}); });
if (result.data.length < 25 && this.state.hasMore) { if (this.state.historyList.length < 25 && this.state.hasMore) {
this.reloadMore(); this.reloadMore();
} }
} }
} else { } else {
this.setState({ this.setState({
historyList: [...this.state.historyList, ...result.data],
nextCommit: result.next_start_commit, nextCommit: result.next_start_commit,
isLoading: false,
isError: false, isError: false,
}); });
this.reloadMore(); if (this.state.nextCommit) {
seafileAPI.listOldFileHistoryRecords(historyRepoID, filePath, this.state.nextCommit).then((res) => {
this.setState({isReloadingData: false});
this.updateResultState(res.data);
});
}
} }
} }