Skip to content

Commit

Permalink
Global Styles: Dsiable "Reset styles" button when there are no changes
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Jul 15, 2024
1 parent b66e7fa commit e2d855b
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 e2d855b

Please sign in to comment.