diff --git a/render-process/index.tsx b/render-process/index.tsx index b41e0f1..397aa58 100644 --- a/render-process/index.tsx +++ b/render-process/index.tsx @@ -268,6 +268,17 @@ export default class Main extends Component { onChange={activeKey => { this.setState({ curPath: activeKey }) }} + onEdit={(targetKey, action) => { + if (action == 'remove') { + const idx = filepaths.indexOf(targetKey as string); + if(idx < 0) { + return; + } + filepaths.splice(idx, 1); + const nextPath = filepaths[idx - 1]; + this.setState({ filepaths, curPath: nextPath }); + } + }} > { filepaths.map(filepath => {