Skip to content

Commit

Permalink
feat(bbt-83): disable reset if userConfig is the same as baseConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe-Rouse committed Oct 11, 2023
1 parent a2e3607 commit 5d96b2a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/editor/components/ThemerComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ const ThemerComponent = () => {
return merged;
}, [ userConfig, baseConfig ] );

/**
* Returns if the user config is different from the base config.
*/
const userConfigHasChanges = useMemo( () => {
return ! isEqual(
{ ...userConfig?.settings, ...userConfig?.styles },
{ ...baseConfig?.settings, ...baseConfig?.styles }
);
}, [ userConfig, baseConfig ] );

/**
* Fetch new preview CSS whenever config is changed
*/
Expand Down

0 comments on commit 5d96b2a

Please sign in to comment.