Skip to content

Commit

Permalink
Shadows: Don't assume that core provides defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicente Canales committed Feb 13, 2024
1 parent 1a2a1d3 commit 2907e81
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

0 comments on commit 2907e81

Please sign in to comment.