Skip to content

Commit

Permalink
Shadows: Don't assume that core provides defaults (#58973)
Browse files Browse the repository at this point in the history
Co-authored-by: vcanales <vcanales@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>
  • Loading branch information
3 people committed Feb 13, 2024
1 parent 8057df3 commit b35bc15
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import { shadow as shadowIcon, Icon, check } from '@wordpress/icons';
import classNames from 'classnames';

export function ShadowPopoverContainer( { shadow, onShadowChange, settings } ) {
const defaultShadows = settings?.shadow?.presets?.default;
const themeShadows = settings?.shadow?.presets?.theme;
const defaultShadows = settings?.shadow?.presets?.default || [];
const themeShadows = settings?.shadow?.presets?.theme || [];
const defaultPresetsEnabled = settings?.shadow?.defaultPresets;

const shadows = [
...( defaultPresetsEnabled ? defaultShadows : [] ),
...( themeShadows || [] ),
...themeShadows,
];

return (
Expand Down

1 comment on commit b35bc15

@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 b35bc15.
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/7893420926
📝 Reported issues:

Please sign in to comment.