mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
improve key selection
This commit is contained in:
parent
4fcadcd241
commit
4d91eccab2
@ -168,8 +168,10 @@ export default class Sidebar extends React.Component {
|
||||
}
|
||||
|
||||
calculateSelectedMenuItem = (path) => {
|
||||
const items = [...this.state.topItems, ...this.state.bottomItems]
|
||||
|
||||
this.setState({
|
||||
selectedMenuItem: [...this.state.topItems, ...this.state.bottomItems].find((item) => item.path === path)
|
||||
selectedMenuItem: items.find((item) => String(item.path).includes(path)),
|
||||
})
|
||||
}
|
||||
|
||||
@ -352,7 +354,7 @@ export default class Sidebar extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const selectedKeyId = this.state.selectedMenuItem?.id ?? "home"
|
||||
const selectedKeyId = this.state.selectedMenuItem?.id
|
||||
|
||||
return <div
|
||||
className="app_sidebar_wrapper"
|
||||
|
Loading…
x
Reference in New Issue
Block a user