From e2d855b0ea87d046c11ea8b2430562201bcc47ca Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Mon, 15 Jul 2024 21:55:04 +0900 Subject: [PATCH] Global Styles: Dsiable "Reset styles" button when there are no changes --- packages/block-editor/src/components/global-styles/hooks.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/global-styles/hooks.js b/packages/block-editor/src/components/global-styles/hooks.js index 44a3d5e23e40cd..a1a4fc1a0a6ae1 100644 --- a/packages/block-editor/src/components/global-styles/hooks.js +++ b/packages/block-editor/src/components/global-styles/hooks.js @@ -85,7 +85,11 @@ const VALID_SETTINGS = [ ]; export const useGlobalStylesReset = () => { - const { user: config, setUserConfig } = useContext( GlobalStylesContext ); + const { user, setUserConfig } = useContext( GlobalStylesContext ); + const config = { + settings: user.settings, + styles: user.styles, + }; const canReset = !! config && ! fastDeepEqual( config, EMPTY_CONFIG ); return [ canReset,