From 48e5252a7cf047448419e02261ec15f9699e0478 Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Sat, 26 Aug 2023 17:27:21 +0200 Subject: [PATCH] fixed a bug with attempts and chat index --- gui/preload-chat.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gui/preload-chat.js b/gui/preload-chat.js index 89fd926c..473f89a9 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -820,8 +820,8 @@ ipcRenderer.on("action-new-msg-received", (event, arg) => { obj.command = "ping"; obj.checksum = "null"; obj.msg = "null"; - obj.status = item.status; obj.hmac_signed = item.hmac_signed; - + obj.status = item.status; + obj.hmac_signed = item.hmac_signed; obj.snr = item.snr; obj.type = "ping"; obj.filename = "null"; @@ -1009,7 +1009,7 @@ ipcRenderer.on("action-new-msg-received", (event, arg) => { //getSetUserInformation(selected_callsign); } else if (splitted_data[1] == "res-2") { - console.log("In received respons-2"); + console.log("In received response-2"); let sharedFileInfo = splitted_data[2].split("/", 2); obj.uuid = uuidv4().toString(); @@ -1053,16 +1053,13 @@ update_chat = function (obj) { } return doc; }); - obj.attempt = 1; - } - - // define attempts - if (typeof obj.attempt == "undefined") { var attempt = 1; + obj.attempt = attempt; } else { var attempt = obj.attempt; } + // add percent and bytes per minute if not existing //console.log(obj.percent) if (typeof obj.percent == "undefined") { @@ -2194,6 +2191,7 @@ function createChatIndex() { "status", "percent", "attempt", + "hmac_signed", "bytesperminute", "_attachments", "new",