From 15e058f13b7296dc1697d90deff4c94c6896163c Mon Sep 17 00:00:00 2001 From: ramon Date: Thu, 28 Mar 2024 13:22:27 +1100 Subject: [PATCH] We don't need this wild check now that https://github.com/WordPress/gutenberg/pull/60265 is merged --- .../src/components/global-styles/background-panel.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/block-editor/src/components/global-styles/background-panel.js b/packages/block-editor/src/components/global-styles/background-panel.js index 853c881f41f08..76f56c8205b3b 100644 --- a/packages/block-editor/src/components/global-styles/background-panel.js +++ b/packages/block-editor/src/components/global-styles/background-panel.js @@ -135,10 +135,7 @@ export const backgroundPositionToCoords = ( value ) => { }; function InspectorImagePreview( { label, filename, url: imgUrl } ) { - let imgLabel = label || getFilename( imgUrl ); - // getFilename returns 'undefined' as a string. - imgLabel = - !! imgLabel && imgLabel !== 'undefined' ? imgLabel : __( 'Add image' ); + const imgLabel = label || getFilename( imgUrl ) || __( 'Add image' ); return (