mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: correct display of connection status
This commit is contained in:
parent
42e16dd5b3
commit
691b735483
1 changed files with 8 additions and 10 deletions
|
|
@ -201,17 +201,15 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
|
|||
|
||||
// Update the status string (highest priority messages first)
|
||||
val info = model.myNodeInfo.value
|
||||
val statusText = binding.scanStatusText
|
||||
when (connected) {
|
||||
MeshService.ConnectionState.CONNECTED -> {
|
||||
statusText.text = if (region.number == 0) getString(R.string.must_set_region)
|
||||
else getString(R.string.connected_to).format(info?.firmwareString ?: "unknown")
|
||||
}
|
||||
MeshService.ConnectionState.DISCONNECTED ->
|
||||
statusText.text = getString(R.string.not_connected)
|
||||
MeshService.ConnectionState.DEVICE_SLEEP ->
|
||||
statusText.text = getString(R.string.connected_sleeping)
|
||||
else -> {}
|
||||
MeshService.ConnectionState.CONNECTED ->
|
||||
if (region.number == 0) R.string.must_set_region else R.string.connected_to
|
||||
MeshService.ConnectionState.DISCONNECTED -> R.string.not_connected
|
||||
MeshService.ConnectionState.DEVICE_SLEEP -> R.string.connected_sleeping
|
||||
else -> null
|
||||
}?.let {
|
||||
val firmwareString = info?.firmwareString ?: getString(R.string.unknown)
|
||||
scanModel.setErrorText(getString(it, firmwareString))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue