Skip to content

Commit 28296db

Browse files
committed
Reduce logging spam by tracking last connection status in setConnStatus function
1 parent dd31a79 commit 28296db

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

content/wardrive.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,14 +759,21 @@ function setConnectButton(connected) {
759759
* @param {string} text - Connection status text (one of the four states above)
760760
* @param {string} color - Status color class from STATUS_COLORS
761761
*/
762+
// Track last connection status to avoid logging spam
763+
let lastConnStatusText = null;
764+
762765
function setConnStatus(text, color) {
763766
const connectionStatusEl = document.getElementById("connectionStatus");
764767
const statusIndicatorEl = document.getElementById("statusIndicator");
765768
const noiseDisplayEl = document.getElementById("noiseDisplay");
766769

767770
if (!connectionStatusEl) return;
768771

769-
debugLog(`[UI] Connection status: "${text}"`);
772+
// Only log when status actually changes
773+
if (text !== lastConnStatusText) {
774+
debugLog(`[UI] Connection status: "${text}"`);
775+
lastConnStatusText = text;
776+
}
770777

771778
// Format based on connection state
772779
if (text === "Connected") {

0 commit comments

Comments
 (0)