mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-06 17:33:18 +00:00
optimized code
This commit is contained in:
@@ -78,31 +78,17 @@ class Wiki extends Component {
|
|||||||
|
|
||||||
loadSidePanel = (initialPath) => {
|
loadSidePanel = (initialPath) => {
|
||||||
|
|
||||||
if (initialPath === this.homePath) {
|
if (hasIndex) {
|
||||||
if (hasIndex) {
|
this.loadIndexNode();
|
||||||
this.loadIndexNode();
|
} else {
|
||||||
} else {
|
if (isDir === 'none') {
|
||||||
initialPath = '/';
|
initialPath = '/';
|
||||||
|
this.loadNodeAndParentsByPath('/');
|
||||||
|
} else {
|
||||||
this.loadNodeAndParentsByPath(initialPath);
|
this.loadNodeAndParentsByPath(initialPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (initialPath !== this.homePath) {
|
|
||||||
if (isDir === 'None') {
|
|
||||||
if (hasIndex) {
|
|
||||||
this.loadIndexNode();
|
|
||||||
} else {
|
|
||||||
initialPath = '/';
|
|
||||||
this.loadNodeAndParentsByPath(initialPath);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (hasIndex) {
|
|
||||||
this.loadIndexNode();
|
|
||||||
} else {
|
|
||||||
this.loadNodeAndParentsByPath(initialPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadIndexNode = () => {
|
loadIndexNode = () => {
|
||||||
|
Reference in New Issue
Block a user