mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-25 10:55:55 +03:00
Fixes avatar not shown on fresh login
This commit is contained in:
parent
daacf35411
commit
83b8a0ea94
1 changed files with 7 additions and 9 deletions
|
@ -58,14 +58,11 @@ import im.vector.app.features.settings.VectorSettingsActivity.Companion.EXTRA_DI
|
|||
import im.vector.app.features.spaces.SpaceListBottomSheet
|
||||
import im.vector.app.features.workers.signout.BannerState
|
||||
import im.vector.app.features.workers.signout.ServerBackupStatusViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.launch
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
import org.matrix.android.sdk.api.session.crypto.model.DeviceInfo
|
||||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||
import org.matrix.android.sdk.api.util.toMatrixItem
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
|
@ -322,12 +319,6 @@ class NewHomeDetailFragment :
|
|||
private fun setupToolbar() {
|
||||
setupToolbar(views.toolbar)
|
||||
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
session.userService().getUser(session.myUserId)?.let { user ->
|
||||
avatarRenderer.render(user.toMatrixItem(), views.avatar)
|
||||
}
|
||||
}
|
||||
|
||||
views.collapsingToolbar.debouncedClicks(::openSpaceSettings)
|
||||
views.toolbar.debouncedClicks(::openSpaceSettings)
|
||||
|
||||
|
@ -373,9 +364,16 @@ class NewHomeDetailFragment :
|
|||
vectorPreferences.developerShowDebugInfo()
|
||||
)
|
||||
|
||||
refreshAvatar()
|
||||
hasUnreadRooms = it.hasUnreadMessages
|
||||
}
|
||||
|
||||
private fun refreshAvatar() = withState(viewModel) { state ->
|
||||
state.myMatrixItem?.let { user ->
|
||||
avatarRenderer.render(user, views.avatar)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTapToReturnToCall() {
|
||||
callManager.getCurrentCall()?.let { call ->
|
||||
VectorCallActivity.newIntent(
|
||||
|
|
Loading…
Reference in a new issue