Skip to content

Commit d280c28

Browse files
CopilotMrAlders0n
andcommitted
Use strict equality checks for null/undefined
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
1 parent b2d1863 commit d280c28

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

content/wardrive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ async function connect() {
20782078

20792079
// Only set "Disconnected" status for normal disconnections
20802080
// Preserve error messages (app_down, capacity_full, error) instead of overwriting
2081-
if (state.disconnectReason === "normal" || state.disconnectReason == null) {
2081+
if (state.disconnectReason === "normal" || state.disconnectReason === null || state.disconnectReason === undefined) {
20822082
setStatus("Disconnected", STATUS_COLORS.error);
20832083
} else {
20842084
debugLog(`Preserving disconnect status for reason: ${state.disconnectReason}`);
@@ -2125,7 +2125,7 @@ async function disconnect() {
21252125
connectBtn.disabled = true;
21262126

21272127
// Set disconnectReason to "normal" if not already set (for user-initiated disconnects)
2128-
if (state.disconnectReason == null) {
2128+
if (state.disconnectReason === null || state.disconnectReason === undefined) {
21292129
state.disconnectReason = "normal";
21302130
}
21312131

0 commit comments

Comments
 (0)