fix: explorer update issue
This commit is contained in:
1 parent
40b83c2876
commit
e36b9694cb
1 file changed
+4
-1
@@ -243,7 +243,9 @@ export default class Explorer extends Component<ExplorerProps> {
|
|||||||
shouldComponentUpdate(nextProps: ExplorerProps) {
|
shouldComponentUpdate(nextProps: ExplorerProps) {
|
||||||
const shouldUpdate = this.curWorkdir != nextProps.workdir;
|
const shouldUpdate = this.curWorkdir != nextProps.workdir;
|
||||||
this.curWorkdir = nextProps.workdir;
|
this.curWorkdir = nextProps.workdir;
|
||||||
|
if(shouldUpdate){
|
||||||
this.updateRoot();
|
this.updateRoot();
|
||||||
|
}
|
||||||
return shouldUpdate;
|
return shouldUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,7 +353,8 @@ export default class Explorer extends Component<ExplorerProps> {
|
|||||||
selectNode(id:string){
|
selectNode(id:string){
|
||||||
this.setState({
|
this.setState({
|
||||||
selectedKey:id
|
selectedKey:id
|
||||||
})
|
});
|
||||||
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
renderItem(node: FileDataNode) {
|
renderItem(node: FileDataNode) {
|
||||||
|
|||||||
Reference in new issue
Block a user