Skip to content

Commit abfdb5f

Browse files
Fix MQTT dashboard toggle not showing connecting status immediately
- Set MQTT state to CONNECTING before dispatching IO coroutine
1 parent 36249b6 commit abfdb5f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

networksurvey/src/main/java/com/craxiom/networksurvey/ui/dashboard/DashboardViewModel.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ class DashboardViewModel(application: Application) : AndroidViewModel(applicatio
431431
return
432432
}
433433

434+
if (connect) {
435+
_mqttState.update { it.copy(connectionState = ConnectionState.CONNECTING) }
436+
}
437+
434438
viewModelScope.launch(Dispatchers.IO) {
435439
if (connect) {
436440
val attempting = svc.connectToMqttBrokerUsingSavedConnectionInfo()

networksurvey/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<string name="file_mqtt_help_mqtt_broker_desc">Configure the broker connection settings before enabling streaming</string>
115115
<string name="file_mqtt_help_key_point_title">Key Point</string>
116116
<string name="file_mqtt_help_key_independent_label">Independent</string>
117-
<string name="file_mqtt_help_key_independent_desc">File logging and MQTT streaming work independently you can use either, both, or neither</string>
117+
<string name="file_mqtt_help_key_independent_desc">File logging and MQTT streaming work independently - you can use either, both, or neither</string>
118118

119119
<!-- NS Analytics Help Dialog -->
120120
<string name="ns_analytics_help_title">NS Analytics</string>

0 commit comments

Comments
 (0)