diff --git a/gui/main.js b/gui/main.js index 50c1d92c..b3a0119e 100644 --- a/gui/main.js +++ b/gui/main.js @@ -386,6 +386,11 @@ ipcMain.on("request-show-chat-window", () => { chat.show(); }); +ipcMain.on("request-clear-chat-connected", () => { + //Clear chat window's connected with text + chat.webContents.send("action-clear-reception-status"); +}); + // UPDATE TNC CONNECTION ipcMain.on("request-update-tnc-ip", (event, data) => { win.webContents.send("action-update-tnc-ip", data); diff --git a/gui/preload-chat.js b/gui/preload-chat.js index a4ae8eed..46f0ec6e 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -666,7 +666,14 @@ ipcRenderer.on("action-update-reception-status", (event, arg) => { document.getElementById("txtConnectedWithChat").textContent = data.dxcallsign; }); - +ipcRenderer.on("action-clear-reception-status", (event) => { + //Clear connected with textbox + let cwc = document.getElementById("txtConnectedWithChat"); + if (cwc.textContent != "------") { + cwc.textContent = "------"; + //console.log("Reseting connected with"); + } +}); ipcRenderer.on("action-update-transmission-status", (event, arg) => { var data = arg["data"][0]; diff --git a/gui/preload-main.js b/gui/preload-main.js index b2da4b9a..f2762387 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -2254,6 +2254,7 @@ ipcRenderer.on("action-update-tnc-state", (event, arg) => { "bi bi-chat-fill text-success me-1"; } else { document.getElementById("spnConnectedWith").className = "bi bi-chat-fill"; + ipcRenderer.send("request-clear-chat-connected"); } // HAMLIB STATUS