File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
dotcom-rendering/src/components Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -329,34 +329,38 @@ export const InteractiveBlockComponent = ({
329
329
330
330
// Define some one-time flags
331
331
const isDatawrapperGraphic =
332
- url &&
333
- url . substring &&
334
- url . includes ( 'interactive.guim.co.uk/datawrapper' ) ;
332
+ url && url . includes ( 'interactive.guim.co.uk/datawrapper' )
333
+ ? true
334
+ : false ;
335
335
336
336
const isUploaderEmbedPath =
337
- url &&
338
- url . substring &&
339
- url . includes ( 'interactive.guim.co.uk/uploader/embed/' ) ;
337
+ url && url . includes ( 'interactive.guim.co.uk/uploader/embed/' )
338
+ ? true
339
+ : false ;
340
340
341
341
const scriptUrlIsBoot =
342
342
scriptUrl &&
343
- scriptUrl . substring &&
344
343
scriptUrl . includes (
345
344
'interactive.guim.co.uk/embed/iframe-wrapper/0.1/boot.js' ,
346
- ) ;
345
+ )
346
+ ? true
347
+ : false ;
347
348
348
349
useOnce ( ( ) => {
349
350
// We've brought the behavior from boot.js into this file to avoid loading 2 extra scripts
350
351
351
352
// Define additional one-time flags - these depend on window/document objects
352
353
const isRunningInWebEnvironment =
353
354
! document . querySelector ( '.ios' ) &&
354
- ! document . querySelector ( '.android' ) ;
355
+ ! document . querySelector ( '.android' )
356
+ ? true
357
+ : false ;
355
358
356
359
const prefersDarkScheme = window . matchMedia (
357
360
'(prefers-color-scheme: dark)' ,
358
361
) . matches ;
359
- const requiresDarkMode = darkModeAvailable && prefersDarkScheme ;
362
+ const requiresDarkMode =
363
+ darkModeAvailable && prefersDarkScheme ? true : false ;
360
364
361
365
if ( url && scriptUrlIsBoot && placeholderLinkRef . current ) {
362
366
// Prepare for graphic url dynamic updates
You can’t perform that action at this time.
0 commit comments