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 authored and youknowriad committed Feb 20, 2024
1 parent 8f7e6a6 commit 9922ae0
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 9922ae0

Please sign in to comment.