mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
Use derivedStateOf for selectedAccount too
This commit is contained in:
+6
-2
@@ -72,8 +72,12 @@ class RoomSelectPresenter(
|
||||
list.map { it.toMatrixUser() }
|
||||
}
|
||||
}.collectAsState(initial = emptyList())
|
||||
// Fallback to a MatrixUser with only the userId until the sessions are loaded
|
||||
val selectedAccount = accounts.find { it.userId == selectedSessionId } ?: MatrixUser(selectedSessionId)
|
||||
val selectedAccount by remember {
|
||||
derivedStateOf {
|
||||
// Fallback to a MatrixUser with only the userId until the sessions are loaded
|
||||
accounts.find { it.userId == selectedSessionId } ?: MatrixUser(selectedSessionId)
|
||||
}
|
||||
}
|
||||
val otherAccounts by remember {
|
||||
derivedStateOf {
|
||||
accounts.filter { it.userId != selectedSessionId }.toImmutableList()
|
||||
|
||||
Reference in New Issue
Block a user