Skip to content

Commit c7b44c9

Browse files
authored
Merge pull request #90 from MrAlders0n/copilot/fix-console-log-queueing
Fix disconnected messages being queued instead of showing immediately
2 parents d6c6577 + a602eea commit c7b44c9

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

content/wardrive.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,40 +2140,40 @@ async function connect() {
21402140
// Set appropriate status message based on disconnect reason
21412141
if (state.disconnectReason === "capacity_full") {
21422142
debugLog("Branch: capacity_full");
2143-
setStatus("Disconnected: WarDriving app has reached capacity", STATUS_COLORS.error);
2143+
setStatus("Disconnected: WarDriving app has reached capacity", STATUS_COLORS.error, true);
21442144
debugLog("Setting terminal status for capacity full");
21452145
} else if (state.disconnectReason === "app_down") {
21462146
debugLog("Branch: app_down");
2147-
setStatus("Disconnected: WarDriving app is down", STATUS_COLORS.error);
2147+
setStatus("Disconnected: WarDriving app is down", STATUS_COLORS.error, true);
21482148
debugLog("Setting terminal status for app down");
21492149
} else if (state.disconnectReason === "slot_revoked") {
21502150
debugLog("Branch: slot_revoked");
2151-
setStatus("Disconnected: WarDriving slot has been revoked", STATUS_COLORS.error);
2151+
setStatus("Disconnected: WarDriving slot has been revoked", STATUS_COLORS.error, true);
21522152
debugLog("Setting terminal status for slot revocation");
21532153
} else if (state.disconnectReason === "public_key_error") {
21542154
debugLog("Branch: public_key_error");
2155-
setStatus("Disconnected: Unable to read device public key", STATUS_COLORS.error);
2155+
setStatus("Disconnected: Unable to read device public key", STATUS_COLORS.error, true);
21562156
debugLog("Setting terminal status for public key error");
21572157
} else if (state.disconnectReason === "channel_setup_error") {
21582158
debugLog("Branch: channel_setup_error");
21592159
const errorMsg = state.channelSetupErrorMessage || "Channel setup failed";
2160-
setStatus(`Disconnected: ${errorMsg}`, STATUS_COLORS.error);
2160+
setStatus(`Disconnected: ${errorMsg}`, STATUS_COLORS.error, true);
21612161
debugLog("Setting terminal status for channel setup error");
21622162
state.channelSetupErrorMessage = null; // Clear after use (also cleared in cleanup as safety net)
21632163
} else if (state.disconnectReason === "ble_disconnect_error") {
21642164
debugLog("Branch: ble_disconnect_error");
21652165
const errorMsg = state.bleDisconnectErrorMessage || "BLE disconnect failed";
2166-
setStatus(`Disconnected: ${errorMsg}`, STATUS_COLORS.error);
2166+
setStatus(`Disconnected: ${errorMsg}`, STATUS_COLORS.error, true);
21672167
debugLog("Setting terminal status for BLE disconnect error");
21682168
state.bleDisconnectErrorMessage = null; // Clear after use (also cleared in cleanup as safety net)
21692169
} else if (state.disconnectReason === "normal" || state.disconnectReason === null || state.disconnectReason === undefined) {
21702170
debugLog("Branch: normal/null/undefined");
2171-
setStatus("Disconnected", STATUS_COLORS.error);
2171+
setStatus("Disconnected", STATUS_COLORS.error, true);
21722172
} else {
21732173
debugLog(`Branch: else (unknown reason: ${state.disconnectReason})`);
21742174
// For unknown disconnect reasons, show generic disconnected message
21752175
debugLog(`Showing generic disconnected message for unknown reason: ${state.disconnectReason}`);
2176-
setStatus("Disconnected", STATUS_COLORS.error);
2176+
setStatus("Disconnected", STATUS_COLORS.error, true);
21772177
}
21782178

21792179
setConnectButton(false);

0 commit comments

Comments
 (0)