Optimize call flow
This commit is contained in:
parent
96d5652fcd
commit
51c9c2f032
|
@ -132,14 +132,11 @@ class RoomMemberProfileViewModel @AssistedInject constructor(
|
||||||
session.flow()
|
session.flow()
|
||||||
.liveUserAccountData(UserAccountDataTypes.TYPE_OVERRIDE_COLORS)
|
.liveUserAccountData(UserAccountDataTypes.TYPE_OVERRIDE_COLORS)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.map { it.content.toModel<Map<String, String>>() }
|
|
||||||
.map { userColorAccountDataContent ->
|
|
||||||
userColorAccountDataContent?.get(initialState.userId)
|
|
||||||
}
|
|
||||||
.onEach {
|
.onEach {
|
||||||
|
val newUserColor = it.content.toModel<Map<String, String>>()?.get(initialState.userId)
|
||||||
setState {
|
setState {
|
||||||
copy(
|
copy(
|
||||||
userColorOverride = it
|
userColorOverride = newUserColor
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue