@@ -1047,7 +1047,7 @@ async function checkCapacity(reason) {
10471047 // Fail closed on network errors for connect
10481048 if ( reason === "connect" ) {
10491049 debugError ( "Failing closed (denying connection) due to API error" ) ;
1050- setStatus ( "WarDriving app has reached capacity or is down" , STATUS_COLORS . error ) ;
1050+ setStatus ( "WarDriving app is down" , STATUS_COLORS . error ) ;
10511051 return false ;
10521052 }
10531053 return true ; // Always allow disconnect to proceed
@@ -1056,6 +1056,11 @@ async function checkCapacity(reason) {
10561056 const data = await response . json ( ) ;
10571057 debugLog ( `Capacity check response: allowed=${ data . allowed } ` ) ;
10581058
1059+ // Handle capacity full vs. allowed cases separately
1060+ if ( data . allowed === false && reason === "connect" ) {
1061+ setStatus ( "WarDriving app has reached capacity" , STATUS_COLORS . error ) ;
1062+ }
1063+
10591064 return data . allowed === true ;
10601065
10611066 } catch ( error ) {
@@ -1064,7 +1069,7 @@ async function checkCapacity(reason) {
10641069 // Fail closed on network errors for connect
10651070 if ( reason === "connect" ) {
10661071 debugError ( "Failing closed (denying connection) due to network error" ) ;
1067- setStatus ( "WarDriving app has reached capacity or is down" , STATUS_COLORS . error ) ;
1072+ setStatus ( "WarDriving app is down" , STATUS_COLORS . error ) ;
10681073 return false ;
10691074 }
10701075
@@ -1108,7 +1113,7 @@ async function postToMeshMapperAPI(lat, lon, heardRepeats) {
11081113 const data = await response . json ( ) ;
11091114 if ( data . allowed === false ) {
11101115 debugWarn ( "MeshMapper API returned allowed=false, disconnecting" ) ;
1111- setStatus ( "WarDriving app has reached capacity or is down " , STATUS_COLORS . error ) ;
1116+ setStatus ( "WarDriving app has reached capacity" , STATUS_COLORS . error ) ;
11121117 // Disconnect after a brief delay to ensure user sees the message
11131118 setTimeout ( ( ) => {
11141119 disconnect ( ) . catch ( err => debugError ( `Disconnect after capacity denial failed: ${ err . message } ` ) ) ;
@@ -2044,7 +2049,7 @@ async function connect() {
20442049 const allowed = await checkCapacity ( "connect" ) ;
20452050 if ( ! allowed ) {
20462051 debugWarn ( "Capacity check denied, disconnecting" ) ;
2047- setStatus ( "WarDriving app has reached capacity or is down" , STATUS_COLORS . error ) ;
2052+ // Status message already set by checkCapacity()
20482053 // Disconnect after a brief delay to ensure user sees the message
20492054 setTimeout ( ( ) => {
20502055 disconnect ( ) . catch ( err => debugError ( `Disconnect after capacity denial failed: ${ err . message } ` ) ) ;
0 commit comments