Skip to content

Commit dd1649f

Browse files
Rik Rootsfrederickobrien
authored andcommitted
Fix TS issues
1 parent 035667c commit dd1649f

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

dotcom-rendering/src/components/InteractiveBlockComponent.importable.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -329,34 +329,38 @@ export const InteractiveBlockComponent = ({
329329

330330
// Define some one-time flags
331331
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;
335335

336336
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;
340340

341341
const scriptUrlIsBoot =
342342
scriptUrl &&
343-
scriptUrl.substring &&
344343
scriptUrl.includes(
345344
'interactive.guim.co.uk/embed/iframe-wrapper/0.1/boot.js',
346-
);
345+
)
346+
? true
347+
: false;
347348

348349
useOnce(() => {
349350
// We've brought the behavior from boot.js into this file to avoid loading 2 extra scripts
350351

351352
// Define additional one-time flags - these depend on window/document objects
352353
const isRunningInWebEnvironment =
353354
!document.querySelector('.ios') &&
354-
!document.querySelector('.android');
355+
!document.querySelector('.android')
356+
? true
357+
: false;
355358

356359
const prefersDarkScheme = window.matchMedia(
357360
'(prefers-color-scheme: dark)',
358361
).matches;
359-
const requiresDarkMode = darkModeAvailable && prefersDarkScheme;
362+
const requiresDarkMode =
363+
darkModeAvailable && prefersDarkScheme ? true : false;
360364

361365
if (url && scriptUrlIsBoot && placeholderLinkRef.current) {
362366
// Prepare for graphic url dynamic updates

0 commit comments

Comments
 (0)