Skip to content

Commit 6afa687

Browse files
committed
fix: better code
1 parent 387cb0e commit 6afa687

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/containers/AsideNavigation/AsideNavigation.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,11 @@ export function AsideNavigation(props: AsideNavigationProps) {
101101
hotkeys(SHORTCUTS_HOTKEY, openHotkeysPanel);
102102

103103
// Add listener for custom event from Monaco editor
104-
const handleOpenKeyboardShortcutsPanel = () => {
105-
openHotkeysPanel();
106-
};
107-
108-
window.addEventListener('openKeyboardShortcutsPanel', handleOpenKeyboardShortcutsPanel);
104+
window.addEventListener('openKeyboardShortcutsPanel', openHotkeysPanel);
109105

110106
return () => {
111107
hotkeys.unbind(SHORTCUTS_HOTKEY);
112-
window.removeEventListener(
113-
'openKeyboardShortcutsPanel',
114-
handleOpenKeyboardShortcutsPanel,
115-
);
108+
window.removeEventListener('openKeyboardShortcutsPanel', openHotkeysPanel);
116109
};
117110
}, [openHotkeysPanel]);
118111

0 commit comments

Comments
 (0)