From 313246a01f18e504dabd8313e7eacca728332bcd Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Sat, 27 Jul 2024 17:12:03 +0400 Subject: [PATCH] Fix 'Preferences' and 'Shortcuts' commands in StrictMode (#64019) Co-authored-by: Mamaduka Co-authored-by: t-hamano --- packages/editor/src/components/commands/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/components/commands/index.js b/packages/editor/src/components/commands/index.js index 460a595234e59b..b1471e25583415 100644 --- a/packages/editor/src/components/commands/index.js +++ b/packages/editor/src/components/commands/index.js @@ -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' ); }, } ); @@ -108,7 +109,8 @@ function useEditorCommandLoader() { commands.push( { name: 'core/open-preferences', label: __( 'Editor preferences' ), - callback: () => { + callback: ( { close } ) => { + close(); openModal( 'editor/preferences' ); }, } );