1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 17:33:18 +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) => { listNewHistoryRecords = (filePath, PER_PAGE) => {
editUtilties.listFileHistoryRecords(filePath, 1, PER_PAGE).then(res => { editUtilties.listFileHistoryRecords(filePath, 1, PER_PAGE).then(res => {
let historyList = res.data; let historyData = res.data;
if (historyList.length === 0) { if (!historyData) {
this.setState({isLoading: false}); this.setState({isLoading: false});
throw Error('there has an error in server'); throw Error('there has an error in server');
} }
@@ -56,8 +56,8 @@ class FileHistory extends React.Component {
listOldHistoryRecords = (repoID, filePath) => { listOldHistoryRecords = (repoID, filePath) => {
seafileAPI.listOldFileHistoryRecords(repoID, filePath).then((res) => { seafileAPI.listOldFileHistoryRecords(repoID, filePath).then((res) => {
let historyList = res.data; let historyData = res.data;
if (historyList.length === 0) { if (!historyData) {
this.setState({isLoading: false}); this.setState({isLoading: false});
throw Error('there has an error in server'); throw Error('there has an error in server');
} }