From 2497ff29a15f6fc2a8c0fc1c3906370a945697a7 Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Fri, 20 Sep 2024 21:58:40 +0200 Subject: [PATCH] Make sonar happy --- src/js/serial_backend.js | 2 +- src/js/utils/connection.js | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/js/serial_backend.js b/src/js/serial_backend.js index e2e749a9c3a..bc95ca4ffc1 100644 --- a/src/js/serial_backend.js +++ b/src/js/serial_backend.js @@ -464,7 +464,7 @@ function checkReportProblems() { if (needsProblemReportingDialog) { - problems.map((problem) => { + problems.forEach((problem) => { problemItemTemplate.clone().html(problem.description).appendTo(problemDialogList); }); diff --git a/src/js/utils/connection.js b/src/js/utils/connection.js index a1e501a6628..26d46538121 100644 --- a/src/js/utils/connection.js +++ b/src/js/utils/connection.js @@ -4,14 +4,6 @@ export function ispConnected() { const connected = navigator.onLine; const isMetered = getConfig('meteredConnection').meteredConnection; - if (!navigator.connection) { - return connected && !isMetered; - } - - if (isMetered || navigator.connection.effectiveType === 'none' || !connected) { - return false; - } - - return true; + return connected && !isMetered; }