From b50fcf414fe9c0448f91a448b59d455845057bde Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Mon, 15 May 2023 08:13:33 +0000 Subject: [PATCH] Prettified Code! --- gui/preload-chat.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/gui/preload-chat.js b/gui/preload-chat.js index 546f2c5e..d8721922 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -463,9 +463,10 @@ window.addEventListener("DOMContentLoaded", () => { // check if broadcast dxcallsign.starts; if (dxcallsign.startsWith("BC-")) { - let broadcastChannelId = dxcallsign.split("BC-")[1]; - broadcastChannelIdCRC = crc32(broadcastChannelId).toString(16).toUpperCase(); - + let broadcastChannelId = dxcallsign.split("BC-")[1]; + broadcastChannelIdCRC = crc32(broadcastChannelId) + .toString(16) + .toUpperCase(); dxcallsignWithID = "BC-" + broadcastChannelIdCRC; var tnc_command = "broadcast"; @@ -734,18 +735,16 @@ ipcRenderer.on("action-new-msg-received", (event, arg) => { //handle broadcast if (item.fec == "broadcast") { - - console.log("BROADCAST RECEIVED") - console.log(item) + console.log("BROADCAST RECEIVED"); + console.log(item); var transmitting_station = item.dxcallsign; var encoded_data = FD.atob_FD(item.data); var splitted_data = encoded_data.split(split_char); console.log(splitted_data); - // add callsign to message: var message = transmitting_station + ":" + splitted_data[4]; - console.log(message) + console.log(message); obj.timestamp = Math.floor(Date.now() / 1000); obj.dxcallsign = splitted_data[1]; obj.dxgrid = "null"; @@ -1264,8 +1263,8 @@ update_chat = function (obj) { `; } - if (obj.type == "broadcast") { - var new_message = ` + if (obj.type == "broadcast") { + var new_message = `
@@ -1286,7 +1285,7 @@ update_chat = function (obj) {
`; - } + } if (obj.type == "transmit") { //console.log('msg-' + obj._id + '-status')