@@ -325,7 +325,7 @@ export const InteractiveBlockComponent = ({
325
325
const wrapperRef = useRef < HTMLDivElement > ( null ) ;
326
326
const placeholderLinkRef = useRef < HTMLAnchorElement > ( null ) ;
327
327
const [ loaded , setLoaded ] = useState ( false ) ;
328
- const { darkModeAvailable } = useConfig ( ) ;
328
+ const { darkModeAvailable, renderingTarget } = useConfig ( ) ;
329
329
330
330
// Define some one-time flags
331
331
const isDatawrapperGraphic =
@@ -352,13 +352,6 @@ export const InteractiveBlockComponent = ({
352
352
useOnce ( ( ) => {
353
353
// We've brought the behavior from boot.js into this file to avoid loading 2 extra scripts
354
354
355
- // Define additional one-time flags - these depend on window/document objects
356
- const isRunningInWebEnvironment =
357
- ! document . querySelector ( '.ios' ) &&
358
- ! document . querySelector ( '.android' )
359
- ? true
360
- : false ;
361
-
362
355
const prefersDarkScheme = window . matchMedia (
363
356
'(prefers-color-scheme: dark)' ,
364
357
) . matches ;
@@ -382,7 +375,7 @@ export const InteractiveBlockComponent = ({
382
375
}
383
376
384
377
// Fix darkmode for web environment
385
- if ( isRunningInWebEnvironment && ! requiresDarkMode ) {
378
+ if ( renderingTarget === 'Web' && ! requiresDarkMode ) {
386
379
if ( isDatawrapperGraphic || isUploaderEmbedPath ) {
387
380
// Add the 'dark=false' search param
388
381
if ( graphicUrl . search . length ) {
0 commit comments