Skip to content

Commit

Permalink
Make sonar happy
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Sep 21, 2024
1 parent 04ca343 commit 2045b46
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/js/serial_backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ function checkReportProblems() {

if (needsProblemReportingDialog) {

problems.map((problem) => {
problems.forEach((problem) => {
problemItemTemplate.clone().html(problem.description).appendTo(problemDialogList);
});

Expand Down
4 changes: 2 additions & 2 deletions src/js/tabs/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@ options.initMeteredConnection = function () {
const result = getConfig("meteredConnection");
$("div.meteredConnection input")
.prop("checked", !!result.meteredConnection)
.change(function () {
.on('change', function () {
setConfig({ meteredConnection: $(this).is(":checked") });
// update network status
ispConnected();
})
.change();
.trigger('change');
};

// TODO: remove when modules are in place
Expand Down
10 changes: 1 addition & 9 deletions src/js/utils/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 2045b46

Please sign in to comment.