Skip to content

Commit

Permalink
Revise code style
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesman committed Sep 23, 2024
1 parent fb06f1a commit b77c611
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/tools-panel/tools-panel/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ export function useToolsPanel(
const menuGroup = isShownByDefault ? 'default' : 'optional';
const hasValue = menuItems[ menuGroup ][ label ];

if ( ! hasValue ) onSelect?.();
else onDeselect?.();
const callback = ! hasValue ? onSelect : onDeselect;
callback?.();

const newMenuItems = {
...menuItems,
Expand Down

0 comments on commit b77c611

Please sign in to comment.