Codacy JS fixes

This commit is contained in:
Matteo Gheza 2021-04-05 21:07:06 +02:00
parent 8aa334d626
commit ded4682c9b
3 changed files with 6 additions and 6 deletions

View File

@ -203,9 +203,9 @@ async function loadTable ({ tablePage, setInterval = true, interval = 10000, onl
loadTable(tablePage, setInterval, interval); // retry
} // else nothing
} else {
caches.open("tables-1").then(cache => {
cache.match("/table_" + tablePage + ".json").then(response => {
response.json().then(data => {
caches.open("tables-1").then((cache) => {
cache.match("/table_" + tablePage + ".json").then((response) => {
response.json().then((data) => {
fillTable({ data, replaceLatLngWithMap, callback });
console.log("Table loaded from cache");
$("#offline_update").text(new Date(parseInt(response.headers.get("date"), 10)).toLocaleString());

View File

@ -85,12 +85,12 @@ function loadMap (lat = undefined, lng = undefined, selectorId = undefined, sele
window.addEventListener("focus", function (event) {
if ($("#addr").val() === "") {
console.log("Loading location from clipboard");
navigator.clipboard.readText().then(text => {
navigator.clipboard.readText().then((text) => {
$("#addr").val(text);
if (!addrSearch()) {
$("#addr").val("");
}
}).catch(err => {
}).catch((err) => {
console.error("Failed to read clipboard contents: ", err);
});
}

View File

@ -42,7 +42,7 @@ const removeSourceMapUrlAfterBuild = () => {
fs.unlinkSync(key);
});
});
}
};
var configFile = require("./config.json");
const sentryEnabled = configFile.sentryEnabled &&