mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-05 19:08:23 +00:00
Optimize relay connection status tracking in EditRelaysDialog
Wrap the `connectedRelaysFlow` mapping in a `remember(relay)` block to prevent unnecessary flow re-allocation and recompositions when the UI updates.
This commit is contained in:
@@ -643,8 +643,10 @@ fun ActiveRelaysScreen(
|
||||
Column(
|
||||
verticalArrangement = Arrangement.Center,
|
||||
) {
|
||||
val isConnected by Amber.instance.client.connectedRelaysFlow().map { status ->
|
||||
relay in status
|
||||
val isConnected by remember(relay) {
|
||||
Amber.instance.client.connectedRelaysFlow().map { status ->
|
||||
relay in status
|
||||
}
|
||||
}.collectAsStateWithLifecycle(relay in Amber.instance.client.connectedRelaysFlow().value)
|
||||
|
||||
Row(
|
||||
|
||||
Reference in New Issue
Block a user