Prettified Code!

This commit is contained in:
Mashintime 2023-08-07 17:04:04 +00:00 committed by GitHub Action
parent 41554904e5
commit 62620f4f9c
2 changed files with 17 additions and 8 deletions

View file

@ -1062,7 +1062,9 @@ function downloadJsonUrlToFile(url, callsignPath) {
//console.log(d); //console.log(d);
let json = JSON.parse(d); let json = JSON.parse(d);
fs.writeFileSync(callsignPath, JSON.stringify(json, null, 2)); fs.writeFileSync(callsignPath, JSON.stringify(json, null, 2));
sysInfo.info("Download " + url +" return statuscode: " + res.statusCode); sysInfo.info(
"Download " + url + " return statuscode: " + res.statusCode,
);
}); });
}) })
.on("error", (e) => { .on("error", (e) => {

View file

@ -145,8 +145,6 @@ var chatFilter = [
//{ type: "response" }, //{ type: "response" },
]; ];
// WINDOW LISTENER // WINDOW LISTENER
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
updateAllChat(false); updateAllChat(false);
@ -219,7 +217,12 @@ window.addEventListener("DOMContentLoaded", () => {
chatFilter.length = 0; chatFilter.length = 0;
if (document.getElementById("chkMessage").checked == true) { if (document.getElementById("chkMessage").checked == true) {
chatFilter = [{ type: "newchat" }]; chatFilter = [{ type: "newchat" }];
chatFilter.push({ type: "received" }, { type: "transmit" }, { type: "broadcast_received" },{ type: "broadcast_transmit" }); chatFilter.push(
{ type: "received" },
{ type: "transmit" },
{ type: "broadcast_received" },
{ type: "broadcast_transmit" },
);
} }
if (document.getElementById("chkPing").checked == true) if (document.getElementById("chkPing").checked == true)
chatFilter.push({ type: "ping" }); chatFilter.push({ type: "ping" });
@ -1073,11 +1076,15 @@ update_chat = function (obj) {
} }
} }
// check if in transmitting status and @ 100% // check if in transmitting status and @ 100%
if (obj.status == "transmitting" && obj.type == "transmit" && obj.percent == 100) { if (
obj.status == "transmitting" &&
obj.type == "transmit" &&
obj.percent == 100
) {
var TimeDifference = new Date().getTime() / 1000 - obj.timestamp; var TimeDifference = new Date().getTime() / 1000 - obj.timestamp;
if (TimeDifference > 21600) { if (TimeDifference > 21600) {
//Six hours //Six hours
console.log( console.log(
"Resetting message to transmitted since in transmit state and at 100%:", "Resetting message to transmitted since in transmit state and at 100%:",
); );
console.log(obj); console.log(obj);
@ -1086,8 +1093,8 @@ update_chat = function (obj) {
return doc; return doc;
}); });
obj.status = "transmitted"; obj.status = "transmitted";
}
} }
}
if (typeof obj.new == "undefined") { if (typeof obj.new == "undefined") {
obj.new = 0; obj.new = 0;
} }