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,24 +220,31 @@ class LibContentView extends React.Component {
|
||||
});
|
||||
});
|
||||
|
||||
if (this.state.currentMode === 'column') {
|
||||
// there will be only two constence. path is file or path is dir.
|
||||
if (Utils.isMarkdownFile(path)) {
|
||||
seafileAPI.getFileInfo(this.props.repoID, path).then(() => {
|
||||
if (this.state.currentMode !== 'column') {
|
||||
cookie.save('seafile-view-mode', 'column');
|
||||
this.setState({currentMode: 'column'});
|
||||
}
|
||||
this.loadSidePanel(path);
|
||||
this.showFile(path);
|
||||
}).catch(() => {
|
||||
this.showDir(path); // After an error occurs, follow dir
|
||||
});
|
||||
if (this.state.currentMode === 'column') { // After an error occurs, follow dir
|
||||
this.loadSidePanel(path);
|
||||
this.showDir(path);
|
||||
} else {
|
||||
this.showDir(path);
|
||||
}
|
||||
// load side-panel data
|
||||
});
|
||||
} else {
|
||||
if (this.state.currentMode === 'column') {
|
||||
this.loadSidePanel(path);
|
||||
|
||||
this.showDir(path);
|
||||
} else {
|
||||
this.showDir(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadSidePanel = (path) => {
|
||||
let repoID = this.props.repoID;
|
||||
|
Reference in New Issue
Block a user