From e83f5c688c2b46c66d5559d1f373419aa64ef2e5 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Fri, 3 Nov 2023 16:15:26 +0000 Subject: [PATCH] Fallback to device style if theme styles undefined As described in the following feedback, there can be times when the editor background colour returns an "undefined" string: https://github.com/WordPress/gutenberg/pull/55627/#discussion_r1377462299 With this commit, that case is accounted for, with the default dark/light styles being applied. --- packages/components/src/mobile/audio-player/index.native.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/components/src/mobile/audio-player/index.native.js b/packages/components/src/mobile/audio-player/index.native.js index de11626d162f71..99f5148dbda39e 100644 --- a/packages/components/src/mobile/audio-player/index.native.js +++ b/packages/components/src/mobile/audio-player/index.native.js @@ -76,7 +76,10 @@ function Player( { const editorColors = globalStyles?.baseColors?.color; const editorBackgroundColor = editorColors?.background; - if ( typeof editorBackgroundColor === 'undefined' ) { + if ( + typeof editorBackgroundColor === 'undefined' || + editorBackgroundColor === 'undefined' + ) { return getStylesFromColorScheme( baseStyle, darkStyle ); }