mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor(connections): use collectAsStateWithLifecycle for UI state (#2850)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
64efcf8211
commit
4ad80b019c
1 changed files with 3 additions and 4 deletions
|
|
@ -134,16 +134,15 @@ fun ConnectionsScreen(
|
|||
onConfigNavigate: (Route) -> Unit,
|
||||
) {
|
||||
val radioConfigState by radioConfigViewModel.radioConfigState.collectAsStateWithLifecycle()
|
||||
val config by uiViewModel.localConfig.collectAsState()
|
||||
val config by uiViewModel.localConfig.collectAsStateWithLifecycle()
|
||||
val currentRegion = config.lora.region
|
||||
val scrollState = rememberScrollState()
|
||||
val scanStatusText by scanModel.errorText.observeAsState("")
|
||||
val connectionState by uiViewModel.connectionState.collectAsState(ConnectionState.DISCONNECTED)
|
||||
val connectionState by uiViewModel.connectionState.collectAsStateWithLifecycle(ConnectionState.DISCONNECTED)
|
||||
val scanning by scanModel.spinner.collectAsStateWithLifecycle(false)
|
||||
val receivingLocationUpdates by uiViewModel.receivingLocationUpdates.collectAsState(false)
|
||||
val context = LocalContext.current
|
||||
val app = (context.applicationContext as GeeksvilleApplication)
|
||||
val info by uiViewModel.myNodeInfo.collectAsState()
|
||||
val info by uiViewModel.myNodeInfo.collectAsStateWithLifecycle()
|
||||
val selectedDevice by scanModel.selectedNotNullFlow.collectAsStateWithLifecycle()
|
||||
val bluetoothEnabled by bluetoothViewModel.enabled.collectAsStateWithLifecycle(false)
|
||||
val regionUnset =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue