Skip to content

Commit

Permalink
Global Styles: Disable "Reset styles" button when there are no changes (
Browse files Browse the repository at this point in the history
#63562)

Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
  • Loading branch information
3 people committed Jul 16, 2024
1 parent ac29b27 commit b346c8e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/block-editor/src/components/global-styles/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b346c8e

Please sign in to comment.