Skip to content

Commit

Permalink
Layout: Fix issue where saving user global styles included layout def…
Browse files Browse the repository at this point in the history
…initions in layout settings (#50268)
  • Loading branch information
andrewserong authored and bph committed May 3, 2023
1 parent 1734bcf commit e1113e5
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ export default function DimensionsPanel( { name, variation = '' } ) {
setStyle( updatedStyle );

if ( newStyle.layout !== settings.layout ) {
setSettings( {
...rawSettings,
layout: newStyle.layout,
} );
const updatedSettings = { ...rawSettings, layout: newStyle.layout };

// Ensure any changes to layout definitions are not persisted.
if ( updatedSettings.layout?.definitions ) {
delete updatedSettings.layout.definitions;
}

setSettings( updatedSettings );
}
};

Expand Down

0 comments on commit e1113e5

Please sign in to comment.