Skip to content

Commit 1b876d7

Browse files
committed
fix: review fixes
1 parent fa659d3 commit 1b876d7

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/containers/AsideNavigation/AsideNavigation.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ export function AsideNavigation(props: AsideNavigationProps) {
7676
const [informationPopupVisible, setInformationPopupVisible] = React.useState(false);
7777
const [compact, setIsCompact] = useSetting<boolean>(ASIDE_HEADER_COMPACT_KEY);
7878

79-
const toggleInformationPopup = React.useCallback(
80-
() => setInformationPopupVisible(!informationPopupVisible),
81-
[informationPopupVisible],
82-
);
79+
const toggleInformationPopup = () => setInformationPopupVisible((prev) => !prev);
8380

8481
const closeInformationPopup = React.useCallback(() => setInformationPopupVisible(false), []);
8582

src/containers/Tenant/Query/QueryEditor/YqlEditor.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,6 @@ export function YqlEditor({
102102
}
103103
});
104104

105-
editor.addAction({
106-
id: 'openKeyboardShortcutsPanel',
107-
label: i18n('action.open-shortcuts'),
108-
keybindings: [keybindings.shortcutsHotkey],
109-
run: () => {
110-
// Dispatch an event that can be caught by the AsideNavigation component
111-
const event = new CustomEvent('openKeyboardShortcutsPanel');
112-
window.dispatchEvent(event);
113-
},
114-
});
115-
116105
if (window.api.codeAssist) {
117106
setMonacoGhostInstance(createMonacoGhostInstance(editor));
118107
}
@@ -193,6 +182,18 @@ export function YqlEditor({
193182
NiceModal.show(SAVE_QUERY_DIALOG);
194183
},
195184
});
185+
editor.addAction({
186+
id: 'openKeyboardShortcutsPanel',
187+
label: i18n('action.open-shortcuts'),
188+
keybindings: [keybindings.shortcutsHotkey],
189+
contextMenuGroupId: CONTEXT_MENU_GROUP_ID,
190+
contextMenuOrder: 4,
191+
run: () => {
192+
// Dispatch an event that can be caught by the AsideNavigation component
193+
const event = new CustomEvent('openKeyboardShortcutsPanel');
194+
window.dispatchEvent(event);
195+
},
196+
});
196197
};
197198

198199
const onChange = (newValue: string) => {

0 commit comments

Comments
 (0)