Skip to content

Commit 4ed0afd

Browse files
committed
Refactor auto ping scheduling to always restart the timer after any ping, ensuring consistent interval management
1 parent d7c3193 commit 4ed0afd

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

content/wardrive.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4959,15 +4959,12 @@ async function sendPing(manual = false) {
49594959
// This is the key change: we don't wait for API to complete
49604960
if (state.connection) {
49614961
if (state.txRxAutoRunning) {
4962-
// Check if we should resume a paused auto countdown (manual ping during auto mode)
4963-
const resumed = resumeAutoCountdown();
4964-
if (!resumed) {
4965-
// No paused timer to resume, schedule new auto ping (this was an auto ping)
4966-
debugLog("[TX/RX AUTO] Scheduling next auto ping immediately after RX window");
4967-
scheduleNextAutoPing();
4968-
} else {
4969-
debugLog("[TX/RX AUTO] Resumed auto countdown after manual ping");
4970-
}
4962+
// Always schedule a fresh auto ping from the full interval
4963+
// (whether this was a manual or auto ping, the timer restarts)
4964+
debugLog("[TX/RX AUTO] Scheduling next auto ping after ping completion");
4965+
// Clear any paused timer state since we're restarting fresh
4966+
state.pausedAutoTimerRemainingMs = null;
4967+
scheduleNextAutoPing();
49714968
} else {
49724969
debugLog("[UI] Setting dynamic status to Idle (manual mode)");
49734970
setDynamicStatus("Idle");

0 commit comments

Comments
 (0)