feat(ui): Simplify connection status message (#3389)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich
2025-10-07 20:50:34 -05:00
committed by GitHub
parent 8baf8714d0
commit 8e28dbcc2d

View File

@@ -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(