From 24527e221ccf9ecf61e0deca384b012caa777cd1 Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Sun, 14 May 2023 20:47:46 +0000 Subject: [PATCH] Prettified Code! --- gui/preload-chat.js | 6 +++--- gui/sock.js | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gui/preload-chat.js b/gui/preload-chat.js index d3a8dde5..ce0cf1b2 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -731,7 +731,7 @@ ipcRenderer.on("action-new-msg-received", (event, arg) => { if (item.fec == "broadcast") { obj.timestamp = Math.floor(Date.now() / 1000); obj.dxcallsign = item.dxcallsign; - obj.dxgrid = 'null'; + obj.dxgrid = "null"; obj.uuid = uuidv4().toString(); obj.command = "msg"; obj.checksum = "null"; @@ -742,11 +742,11 @@ ipcRenderer.on("action-new-msg-received", (event, arg) => { obj.filename = "null"; obj.filetype = "null"; obj.file = "null"; - console.log(obj) + console.log(obj); add_obj_to_database(obj); update_chat_obj_by_uuid(obj.uuid); - //handle ping + //handle ping } else if (item.ping == "received") { obj.timestamp = parseInt(item.timestamp); obj.dxcallsign = item.dxcallsign; diff --git a/gui/sock.js b/gui/sock.js index 1aa03a94..07416e94 100644 --- a/gui/sock.js +++ b/gui/sock.js @@ -243,21 +243,21 @@ client.on("data", function (socketdata) { }); break; - case "broadcast": + case "broadcast": // RX'd FEC BROADCAST - var encoded_data = FD.atob_FD(data["data"]); - var splitted_data = encoded_data.split(split_char); - var messageArray = []; - if (splitted_data[0] == "m") { - messageArray.push(data); - console.log(data); - } + var encoded_data = FD.atob_FD(data["data"]); + var splitted_data = encoded_data.split(split_char); + var messageArray = []; + if (splitted_data[0] == "m") { + messageArray.push(data); + console.log(data); + } - let Messages = { - data: messageArray, - }; - ipcRenderer.send("request-new-msg-received", Messages); - break; + let Messages = { + data: messageArray, + }; + ipcRenderer.send("request-new-msg-received", Messages); + break; } switch (data["cq"]) {