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 May 3, 2023
1 parent a058a39 commit 232bd5c
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

1 comment on commit 232bd5c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 232bd5c.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4868519818
📝 Reported issues:

Please sign in to comment.