mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +00:00
repair column view file loading error (#3013)
* repair column view file loading error * optimized judegment
This commit is contained in:
@@ -220,22 +220,29 @@ class LibContentView extends React.Component {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.state.currentMode === 'column') {
|
if (Utils.isMarkdownFile(path)) {
|
||||||
// there will be only two constence. path is file or path is dir.
|
seafileAPI.getFileInfo(this.props.repoID, path).then(() => {
|
||||||
if (Utils.isMarkdownFile(path)) {
|
if (this.state.currentMode !== 'column') {
|
||||||
seafileAPI.getFileInfo(this.props.repoID, path).then(() => {
|
cookie.save('seafile-view-mode', 'column');
|
||||||
this.showFile(path);
|
this.setState({currentMode: 'column'});
|
||||||
}).catch(() => {
|
}
|
||||||
this.showDir(path); // After an error occurs, follow dir
|
this.loadSidePanel(path);
|
||||||
});
|
this.showFile(path);
|
||||||
|
}).catch(() => {
|
||||||
|
if (this.state.currentMode === 'column') { // After an error occurs, follow dir
|
||||||
|
this.loadSidePanel(path);
|
||||||
|
this.showDir(path);
|
||||||
|
} else {
|
||||||
|
this.showDir(path);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (this.state.currentMode === 'column') {
|
||||||
|
this.loadSidePanel(path);
|
||||||
|
this.showDir(path);
|
||||||
} else {
|
} else {
|
||||||
this.showDir(path);
|
this.showDir(path);
|
||||||
}
|
}
|
||||||
// load side-panel data
|
|
||||||
this.loadSidePanel(path);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.showDir(path);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user