Skip to content

Commit

Permalink
Fix 'Preferences' and 'Shortcuts' commands in StrictMode (#64019)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
  • Loading branch information
3 people committed Jul 27, 2024
1 parent 159d01a commit 313246a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/editor/src/components/commands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ function useEditorCommandLoader() {
name: 'core/open-shortcut-help',
label: __( 'Keyboard shortcuts' ),
icon: keyboard,
callback: () => {
callback: ( { close } ) => {
close();
openModal( 'editor/keyboard-shortcut-help' );
},
} );
Expand All @@ -108,7 +109,8 @@ function useEditorCommandLoader() {
commands.push( {
name: 'core/open-preferences',
label: __( 'Editor preferences' ),
callback: () => {
callback: ( { close } ) => {
close();
openModal( 'editor/preferences' );
},
} );
Expand Down

0 comments on commit 313246a

Please sign in to comment.