From d9c2026c7f60ea08fbdb3e79a0f80883abf6315b Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Thu, 15 Feb 2024 15:05:43 -0300 Subject: [PATCH 1/2] fix empty font sizes --- .../src/components/global-styles/typography-panel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/global-styles/typography-panel.js b/packages/block-editor/src/components/global-styles/typography-panel.js index 6b09b146f9ea17..7fab783c4d0e7b 100644 --- a/packages/block-editor/src/components/global-styles/typography-panel.js +++ b/packages/block-editor/src/components/global-styles/typography-panel.js @@ -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 ) ) { From 886828d4c4d59051a6a6ef9258425ea47772ff24 Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Thu, 15 Feb 2024 15:26:30 -0300 Subject: [PATCH 2/2] fix logic error --- .../block-editor/src/components/global-styles/border-panel.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/block-editor/src/components/global-styles/border-panel.js b/packages/block-editor/src/components/global-styles/border-panel.js index 960c19289157a3..f8144f1545aebe 100644 --- a/packages/block-editor/src/components/global-styles/border-panel.js +++ b/packages/block-editor/src/components/global-styles/border-panel.js @@ -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