fix(file-explorer): fixes #3

This commit is contained in:
EnixCoda 2018-02-08 13:26:57 +08:00
parent 29704ca0f9
commit f2b7261182
2 changed files with 3 additions and 3 deletions

View file

@ -27,7 +27,7 @@ export default class List extends preact.Component {
const { treeData, metaData } = this.props
const { root, nodes } = treeParser.parse(treeData, metaData)
this.visibleNodesGenerator.plantTree(root, nodes)
const currentPath = URLHelper.getCurrentPath()
const currentPath = URLHelper.getCurrentPath(true)
this.tasksAfterRender.push(DOMHelper.focusSearchInput)
if (currentPath.length) {
const nodeExpandedTo = this.visibleNodesGenerator.expandTo(currentPath)

View file

@ -37,9 +37,9 @@ function isInCodePage(metaData = {}) {
)
}
function getCurrentPath() {
function getCurrentPath(decode = false) {
const { path } = parseRaw()
return path
return decode ? path.map(decodeURIComponent) : path
}
export default {