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

modify res data judge

This commit is contained in:
王健辉
2019-04-23 10:45:42 +08:00
parent 02fa5933f2
commit 91fe132354

View File

@@ -45,8 +45,8 @@ class FileHistory extends React.Component {
listNewHistoryRecords = (filePath, PER_PAGE) => {
editUtilties.listFileHistoryRecords(filePath, 1, PER_PAGE).then(res => {
let historyList = res.data;
if (historyList.length === 0) {
let historyData = res.data;
if (!historyData) {
this.setState({isLoading: false});
throw Error('there has an error in server');
}
@@ -56,8 +56,8 @@ class FileHistory extends React.Component {
listOldHistoryRecords = (repoID, filePath) => {
seafileAPI.listOldFileHistoryRecords(repoID, filePath).then((res) => {
let historyList = res.data;
if (historyList.length === 0) {
let historyData = res.data;
if (!historyData) {
this.setState({isLoading: false});
throw Error('there has an error in server');
}