File tree Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ) => {
You can’t perform that action at this time.
0 commit comments