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 (