@@ -185,7 +185,7 @@ setConnStatus("Disconnected", STATUS_COLORS.error);
185185const intervalSelect = $ ( "intervalSelect" ) ; // 15 / 30 / 60 seconds
186186const powerSelect = $ ( "powerSelect" ) ; // "", "0.3w", "0.6w", "1.0w"
187187const deviceModelEl = $ ( "deviceModel" ) ;
188- const zoneStatus = $ ( "zoneStatus" ) ; // Zone status in connection bar
188+ // Zone status removed from connection bar - only shown in settings panel (locationDisplay)
189189const locationDisplay = $ ( "locationDisplay" ) ; // Location (zone code) in settings
190190const slotsDisplay = $ ( "slotsDisplay" ) ; // Slot availability in settings
191191
@@ -882,8 +882,6 @@ function updateZoneStatusUI(zoneData) {
882882
883883 if ( ! zoneData ) {
884884 debugWarn ( `[GEO AUTH] [UI] No zone data provided, setting error state` ) ;
885- zoneStatus . textContent = "Zone check failed" ;
886- zoneStatus . className = "text-xs text-red-400" ;
887885 locationDisplay . textContent = "Unknown" ;
888886 locationDisplay . className = "font-medium text-red-400" ;
889887 updateSlotsDisplay ( null ) ;
@@ -894,7 +892,6 @@ function updateZoneStatusUI(zoneData) {
894892 if ( zoneData . success && zoneData . in_zone ) {
895893 const zone = zoneData . zone ;
896894 const atCapacity = zone . at_capacity ;
897- const slotsText = `Zone: ${ zone . code } ` ;
898895 const statusColor = atCapacity ? "text-amber-300" : "text-emerald-300" ;
899896
900897 // Clear persistent outside zone error if it was set
@@ -904,11 +901,8 @@ function updateZoneStatusUI(zoneData) {
904901 setDynamicStatus ( "—" , STATUS_COLORS . idle ) ; // Clear the dynamic status bar
905902 }
906903
907- zoneStatus . textContent = slotsText ;
908- zoneStatus . className = `text-xs ${ statusColor } ` ;
909-
910904 locationDisplay . textContent = zone . code ;
911- locationDisplay . className = " font-medium text-emerald-300" ;
905+ locationDisplay . className = ` font-medium ${ statusColor } ` ;
912906
913907 updateSlotsDisplay ( zone ) ;
914908
@@ -921,10 +915,6 @@ function updateZoneStatusUI(zoneData) {
921915 const nearest = zoneData . nearest_zone ;
922916 const distText = `Outside zone (${ nearest . distance_km } km to ${ nearest . code } )` ;
923917
924- // Clear zone status in connection bar (don't show distance there)
925- zoneStatus . textContent = "" ;
926- zoneStatus . className = "text-xs text-slate-400" ;
927-
928918 // Set persistent outside zone error - blocks all other dynamic status messages
929919 statusMessageState . outsideZoneError = distText ;
930920 debugLog ( `[GEO AUTH] [UI] Set persistent outside zone error: "${ distText } "` ) ;
@@ -956,24 +946,27 @@ function updateZoneStatusUI(zoneData) {
956946 statusText = "GPS: inaccurate" ;
957947 } else if ( reason === "outofdate" ) {
958948 // App version outdated - show persistent error in dynamic status bar
959- statusText = "" ; // Clear zone status in connection bar
949+ statusText = "" ; // Clear location display
960950 dynamicStatusText = zoneData . message || "App version outdated, please update" ;
961951
962952 // Set persistent error - blocks all other dynamic status messages
963953 statusMessageState . outsideZoneError = dynamicStatusText ;
964- debugLog ( `[GEO AUTH] [UI] Set persistent outofdate error: "${ dynamicStatusText } "` ) ;
954+ debugLog ( `[GEO AUTH] Set persistent outofdate error: "${ dynamicStatusText } "` ) ;
965955
966956 // Show error in dynamic status bar (red)
967957 setDynamicStatus ( dynamicStatusText , STATUS_COLORS . error ) ;
968958
969- // Log as error
970- debugError ( `[GEO AUTH] [UI] ${ dynamicStatusText } ` ) ;
959+ // Disable Connect button - can't use app with outdated version
960+ setConnectButtonDisabled ( true ) ;
961+
962+ // Clear current zone to stop slot refresh timer from running
963+ state . currentZone = null ;
964+
965+ // Log as error (single consolidated message)
966+ debugError ( `[GEO AUTH] ${ dynamicStatusText } ` ) ;
971967 }
972968
973- zoneStatus . textContent = statusText ;
974- zoneStatus . className = "text-xs text-red-400" ;
975-
976- locationDisplay . textContent = "Unknown" ;
969+ locationDisplay . textContent = statusText || "Unknown" ;
977970 locationDisplay . className = "font-medium text-red-400" ;
978971
979972 updateSlotsDisplay ( null ) ;
@@ -1027,10 +1020,10 @@ async function performAppLaunchZoneCheck() {
10271020 setConnectButtonDisabled ( true ) ;
10281021 debugLog ( "[GEO AUTH] [INIT] Connect button disabled during zone check" ) ;
10291022
1030- // Show "Checking zone..." status
1031- zoneStatus . textContent = "Checking zone ..." ;
1032- zoneStatus . classList . remove ( "hidden" ) ;
1033- debugLog ( "[GEO AUTH] [INIT] Zone status set to 'Checking zone ...'" ) ;
1023+ // Show "Checking zone..." in location display
1024+ locationDisplay . textContent = "Checking..." ;
1025+ locationDisplay . className = "font-medium text-slate-400" ;
1026+ debugLog ( "[GEO AUTH] [INIT] Location display set to 'Checking...'" ) ;
10341027
10351028 try {
10361029 // Get valid GPS coordinates
@@ -1109,6 +1102,10 @@ async function performAppLaunchZoneCheck() {
11091102 state . currentZone = result . zone ;
11101103 updateSlotsDisplay ( result . zone ) ;
11111104 debugLog ( `[GEO AUTH] [SLOT REFRESH] Updated slots: ${ result . zone . slots_available } /${ result . zone . slots_max } ` ) ;
1105+ } else if ( result && ! result . success ) {
1106+ // Handle error states (outofdate, etc.) - this will disable button and clear currentZone
1107+ updateZoneStatusUI ( result ) ;
1108+ debugLog ( `[GEO AUTH] [SLOT REFRESH] Zone check failed, updated UI` ) ;
11121109 }
11131110 }
11141111 }
@@ -1893,7 +1890,10 @@ async function checkZoneStatus(coords) {
18931890 } else if ( data . success && ! data . in_zone ) {
18941891 debugLog ( `[GEO AUTH] ⚠️ Outside all zones, nearest: ${ data . nearest_zone . name } (${ data . nearest_zone . code } ) at ${ data . nearest_zone . distance_km } km` ) ;
18951892 } else if ( ! data . success ) {
1896- debugError ( `[GEO AUTH] ❌ Zone check failed: reason=${ data . reason } , message=${ data . message } ` ) ;
1893+ // Only log non-outofdate failures here (outofdate logged in updateZoneStatusUI)
1894+ if ( data . reason !== "outofdate" ) {
1895+ debugError ( `[GEO AUTH] ❌ Zone check failed: reason=${ data . reason } , message=${ data . message } ` ) ;
1896+ }
18971897 }
18981898
18991899 return data ;
@@ -5529,6 +5529,10 @@ async function disconnect() {
55295529 state . currentZone = result . zone ;
55305530 updateSlotsDisplay ( result . zone ) ;
55315531 debugLog ( `[GEO AUTH] [SLOT REFRESH] Updated slots: ${ result . zone . slots_available } /${ result . zone . slots_max } ` ) ;
5532+ } else if ( result && ! result . success ) {
5533+ // Handle error states (outofdate, etc.) - this will disable button and clear currentZone
5534+ updateZoneStatusUI ( result ) ;
5535+ debugLog ( `[GEO AUTH] [SLOT REFRESH] Zone check failed, updated UI` ) ;
55325536 }
55335537 }
55345538 }
0 commit comments