@@ -392,6 +392,28 @@ function resumeAutoCountdown() {
392392 return false ;
393393}
394394
395+ /**
396+ * Handle manual ping blocked during auto mode by resuming the paused countdown
397+ * This ensures the UI returns to showing the auto countdown instead of staying stuck on the skip message
398+ *
399+ * When a manual ping is blocked during auto mode (GPS unavailable, outside geofence, or too close), this function:
400+ * 1. Attempts to resume the paused auto countdown timer with remaining time
401+ * 2. If no paused countdown exists, schedules a new auto ping
402+ * 3. Does nothing if auto mode is not running
403+ *
404+ * @returns {void }
405+ */
406+ function handleManualPingBlockedDuringAutoMode ( ) {
407+ if ( state . running ) {
408+ debugLog ( "Manual ping blocked during auto mode - resuming auto countdown" ) ;
409+ const resumed = resumeAutoCountdown ( ) ;
410+ if ( ! resumed ) {
411+ debugLog ( "No paused countdown to resume, scheduling new auto ping" ) ;
412+ scheduleNextAutoPing ( ) ;
413+ }
414+ }
415+ }
416+
395417function startRxListeningCountdown ( delayMs ) {
396418 debugLog ( `Starting RX listening countdown: ${ delayMs } ms` ) ;
397419 state . rxListeningEndTime = Date . now ( ) + delayMs ;
@@ -1874,6 +1896,10 @@ async function sendPing(manual = false) {
18741896 if ( ! manual && state . running ) {
18751897 scheduleNextAutoPing ( ) ;
18761898 }
1899+ // For manual ping during auto mode, resume the paused countdown
1900+ if ( manual ) {
1901+ handleManualPingBlockedDuringAutoMode ( ) ;
1902+ }
18771903 return ;
18781904 }
18791905
@@ -1890,6 +1916,8 @@ async function sendPing(manual = false) {
18901916 if ( manual ) {
18911917 // Manual ping: show skip message that persists
18921918 setDynamicStatus ( "Ping skipped, outside of geofenced region" , STATUS_COLORS . warning ) ;
1919+ // If auto mode is running, resume the paused countdown
1920+ handleManualPingBlockedDuringAutoMode ( ) ;
18931921 } else if ( state . running ) {
18941922 // Auto ping: schedule next ping and show countdown with skip message
18951923 scheduleNextAutoPing ( ) ;
@@ -1910,6 +1938,8 @@ async function sendPing(manual = false) {
19101938 if ( manual ) {
19111939 // Manual ping: show skip message that persists
19121940 setDynamicStatus ( "Ping skipped, too close to last ping" , STATUS_COLORS . warning ) ;
1941+ // If auto mode is running, resume the paused countdown
1942+ handleManualPingBlockedDuringAutoMode ( ) ;
19131943 } else if ( state . running ) {
19141944 // Auto ping: schedule next ping and show countdown with skip message
19151945 scheduleNextAutoPing ( ) ;
0 commit comments