updatePath can only be called by a dir now
This commit is contained in:
parent
f9b91cc7ca
commit
b7f609ecbb
@ -300,13 +300,13 @@ class FileBrowser extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// after the user clicks on a folder
|
// after the user clicks on a folder
|
||||||
updatePath = (isDir, name) => {
|
updatePath = name => {
|
||||||
if (isDir && !(this.props.menuOpen || this.state.showMenu)) {
|
if (this.props.menuOpen || this.state.showMenu) return;
|
||||||
const newPath = path.join(this.props.currentPath, name)
|
|
||||||
|
|
||||||
this.props.updateFiles(newPath)
|
const newPath = path.join(this.props.currentPath, name)
|
||||||
this.setState({filter: ""})
|
|
||||||
}
|
this.props.updateFiles(newPath)
|
||||||
|
this.setState({filter: ""})
|
||||||
}
|
}
|
||||||
|
|
||||||
// after the user clicks on the back button
|
// after the user clicks on the back button
|
||||||
@ -413,7 +413,7 @@ class FileBrowser extends Component {
|
|||||||
{ this.renderImage(v.MimeType, v.Name) }
|
{ this.renderImage(v.MimeType, v.Name) }
|
||||||
{
|
{
|
||||||
v.IsDir ?
|
v.IsDir ?
|
||||||
<DirNameP onClick={() => this.updatePath(v.IsDir, v.Name)} onContextMenu={this.openMenu}>{ v.Name }</DirNameP>
|
<DirNameP onClick={() => this.updatePath(v.Name)} onContextMenu={this.openMenu}>{ v.Name }</DirNameP>
|
||||||
:
|
:
|
||||||
<FilenameP onContextMenu={this.openMenu}>{ v.Name }</FilenameP>
|
<FilenameP onContextMenu={this.openMenu}>{ v.Name }</FilenameP>
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user