Skip to content

Commit

Permalink
Fix logic error in #58951 (#59101)
Browse files Browse the repository at this point in the history
* fix empty font sizes
* fix logic error

Co-authored-by: matiasbenedetto <mmaattiiaass@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>
  • Loading branch information
3 people committed Feb 15, 2024
1 parent c57b5e4 commit 7063e5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ export default function BorderPanel( {
// Shadow
const shadow = decodeValue( inheritedValue?.shadow );
const shadowPresets = settings?.shadow?.presets ?? {};
const overriddenShadowPresets = shadowPresets
? overrideOrigins( shadowPresets )
: [];
const overriddenShadowPresets = overrideOrigins( shadowPresets ) ?? [];
const setShadow = ( newValue ) => {
const slug = overriddenShadowPresets?.find(
( { shadow: shadowName } ) => shadowName === newValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function useHasTextColumnsControl( settings ) {

function getUniqueFontSizesBySlug( settings ) {
const fontSizes = settings?.typography?.fontSizes ?? {};
const overriddenFontSizes = fontSizes ? overrideOrigins( fontSizes ) : [];
const overriddenFontSizes = overrideOrigins( fontSizes ) ?? [];
const uniqueSizes = [];
for ( const currentSize of overriddenFontSizes ) {
if ( ! uniqueSizes.some( ( { slug } ) => slug === currentSize.slug ) ) {
Expand Down

0 comments on commit 7063e5e

Please sign in to comment.