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

repair history nav bug (#3195)

This commit is contained in:
杨顺强
2019-03-29 18:27:43 +08:00
committed by Daniel Pan
parent e4de5c64b7
commit 6d953a6ef7

View File

@@ -151,7 +151,18 @@ class LibContentView extends React.Component {
}
onpopstate = (event) => {
if (event.state && event.state.path) {
if (event.state && event.state.key) { // root path
if (this.state.path === '/') {
return;
} else {
let path = '/';
this.loadDirentList(path);
this.setState({
path: path,
isViewFile: false
});
}
} else if (event.state && event.state.path) { // file path
let path = event.state.path;
if (this.state.currentMode === 'column') {
if (Utils.isMarkdownFile(path)) { // Judging not strict