Skip to content

Commit

Permalink
Effect for editor settings update
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Dec 17, 2024
1 parent 67c9d71 commit 005a47e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/edit-site/src/components/style-book/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
useContext,
useRef,
useLayoutEffect,
useEffect,
} from '@wordpress/element';
import { ENTER, SPACE } from '@wordpress/keycodes';

Expand Down Expand Up @@ -358,8 +359,11 @@ export const StyleBookPreview = ( { userConfig = {}, isStatic = false } ) => {
( select ) => select( siteEditorStore ).getSettings(),
[]
);

// Update block editor settings because useMultipleOriginColorsAndGradients fetch colours from there.
dispatch( blockEditorStore ).updateSettings( siteEditorSettings );
useEffect( () => {
dispatch( blockEditorStore ).updateSettings( siteEditorSettings );
}, [ siteEditorSettings ] );

const [ section, onChangeSection ] = useSection();

Expand Down

0 comments on commit 005a47e

Please sign in to comment.