From 9920cec64eb16d28fe16848f6a9fd7e564d2cfcb Mon Sep 17 00:00:00 2001 From: Amri Toufali Date: Tue, 10 May 2022 22:08:56 -0700 Subject: [PATCH] fix ESLint weird conditionals --- public/js/monitor.js | 10 ++++++++-- scan-results.js | 3 ++- server.js | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/public/js/monitor.js b/public/js/monitor.js index 4c06d5e22..28a17c238 100644 --- a/public/js/monitor.js +++ b/public/js/monitor.js @@ -545,10 +545,16 @@ async function initCsatBanner () { toggleMobileFeatures(topNavigation) toggleArticles() toggleHeaderStates(header, win) - document.forms ? (restoreInputs(), addFormListeners()) : null // TODO: what is this..? + if (document.forms) { + restoreInputs() + addFormListeners() + } }) - document.forms ? (restoreInputs(), addFormListeners()) : null // TODO: what is this..? + if (document.forms) { + restoreInputs() + addFormListeners() + } let windowWidth = win.outerWidth document.addEventListener('DOMContentLoaded', setHeaderHeight) diff --git a/scan-results.js b/scan-results.js index b449441a4..e7a6e493a 100644 --- a/scan-results.js +++ b/scan-results.js @@ -54,7 +54,8 @@ const scanResult = async (req, selfScan = false) => { // Checks for a signedInUser arriving from doorhanger. if (signedInUser && url.searchParams.has('utm_source') && url.searchParams.get('utm_source') === 'firefox') { - doorhangerScan = true, selfScan = true + doorhangerScan = true + selfScan = true specificBreach = allBreaches.find(thisBreach(req.query.breach)) } diff --git a/server.js b/server.js index 46c7eb282..393bca165 100644 --- a/server.js +++ b/server.js @@ -233,8 +233,8 @@ if (AppConstants.FXA_ENABLED) { } app.use('/scan', ScanRoutes) app.use('/ses', SesRoutes) -app.use('/user', UserRoutes); -(devOrHeroku ? app.use('/email-l10n', EmailL10nRoutes) : null) +app.use('/user', UserRoutes) +if (devOrHeroku) app.use('/email-l10n', EmailL10nRoutes) app.use('/breach-details', BreachRoutes) app.use('/', HomeRoutes)