Skip to content

Commit

Permalink
style: abbreviated logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cycleccc committed Oct 24, 2024
1 parent 48891bc commit 6fd5a90
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/core/src/menus/bar/Toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,9 @@ class Toolbar {

// 排除某些菜单
const filteredKeys = toolbarKeysWithInsertedKeys.filter(key => {
if (typeof key === 'string') {
// 普通菜单
if (excludeKeys.includes(key)) { return false }
// group
} else if (excludeKeys.includes(key.key)) { return false }
const keyToCheck = typeof key === 'string' ? key : key.key

return true
return !excludeKeys.includes(keyToCheck)
})
const filteredKeysLength = filteredKeys.length

Expand Down

0 comments on commit 6fd5a90

Please sign in to comment.