mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-12 19:07:28 -04:00
feat(ui): Simplify connection status message (#3389)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
@@ -104,7 +104,6 @@ fun ConnectionsScreen(
|
||||
connectionsViewModel.connectionState.collectAsStateWithLifecycle(ConnectionState.DISCONNECTED)
|
||||
val scanning by scanModel.spinner.collectAsStateWithLifecycle(false)
|
||||
val context = LocalContext.current
|
||||
val info by connectionsViewModel.myNodeInfo.collectAsStateWithLifecycle()
|
||||
val ourNode by connectionsViewModel.ourNodeInfo.collectAsStateWithLifecycle()
|
||||
val selectedDevice by scanModel.selectedNotNullFlow.collectAsStateWithLifecycle()
|
||||
val bluetoothState by connectionsViewModel.bluetoothState.collectAsStateWithLifecycle()
|
||||
@@ -149,15 +148,12 @@ fun ConnectionsScreen(
|
||||
LaunchedEffect(connectionState, regionUnset) {
|
||||
when (connectionState) {
|
||||
ConnectionState.CONNECTED -> {
|
||||
if (regionUnset) R.string.must_set_region else R.string.connected_to
|
||||
if (regionUnset) R.string.must_set_region else R.string.connected
|
||||
}
|
||||
|
||||
ConnectionState.DISCONNECTED -> R.string.not_connected
|
||||
ConnectionState.DEVICE_SLEEP -> R.string.connected_sleeping
|
||||
}.let {
|
||||
val firmwareString = info?.firmwareString ?: context.getString(R.string.unknown)
|
||||
scanModel.setErrorText(context.getString(it, firmwareString))
|
||||
}
|
||||
}.let { scanModel.setErrorText(context.getString(it)) }
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
|
||||
Reference in New Issue
Block a user