mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-23 08:10:15 +01:00
display profile faster from known info
This commit is contained in:
parent
9d6e7d7bd0
commit
2e0a84ccc9
@ -24,6 +24,7 @@ import com.airbnb.mvrx.Async
|
||||
import com.airbnb.mvrx.FragmentViewModelContext
|
||||
import com.airbnb.mvrx.MvRxViewModelFactory
|
||||
import com.airbnb.mvrx.Success
|
||||
import com.airbnb.mvrx.Uninitialized
|
||||
import com.airbnb.mvrx.ViewModelContext
|
||||
import com.squareup.inject.assisted.Assisted
|
||||
import com.squareup.inject.assisted.AssistedInject
|
||||
@ -85,7 +86,12 @@ class RoomMemberProfileViewModel @AssistedInject constructor(@Assisted private v
|
||||
}
|
||||
|
||||
init {
|
||||
setState { copy(isMine = session.myUserId == this.userId) }
|
||||
setState {
|
||||
copy(
|
||||
isMine = session.myUserId == this.userId,
|
||||
userMatrixItem = room?.getRoomMember(initialState.userId)?.toMatrixItem()?.let { Success(it) } ?: Uninitialized
|
||||
)
|
||||
}
|
||||
observeIgnoredState()
|
||||
viewModelScope.launch(Dispatchers.Main) {
|
||||
// Do we have a room member for this id.
|
||||
@ -101,6 +107,7 @@ class RoomMemberProfileViewModel @AssistedInject constructor(@Assisted private v
|
||||
observeRoomMemberSummary(room)
|
||||
observeRoomSummaryAndPowerLevels(room)
|
||||
}
|
||||
}
|
||||
|
||||
session.rx().liveUserCryptoDevices(initialState.userId)
|
||||
.map {
|
||||
@ -121,7 +128,6 @@ class RoomMemberProfileViewModel @AssistedInject constructor(@Assisted private v
|
||||
copy(userMXCrossSigningInfo = it.invoke()?.getOrNull())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun observeIgnoredState() {
|
||||
session.rx().liveIgnoredUsers()
|
||||
|
Loading…
Reference in New Issue
Block a user