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