mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-29 06:28:45 +03:00
Merge pull request #7018 from vector-im/bugfix/eric/new-layout-login-avatar
App Layout - Fixes avatar not showing on fresh login
This commit is contained in:
commit
d6b7fcebde
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.spaces.SpaceListBottomSheet
|
||||||
import im.vector.app.features.workers.signout.BannerState
|
import im.vector.app.features.workers.signout.BannerState
|
||||||
import im.vector.app.features.workers.signout.ServerBackupStatusViewModel
|
import im.vector.app.features.workers.signout.ServerBackupStatusViewModel
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.flow.launchIn
|
import kotlinx.coroutines.flow.launchIn
|
||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import org.matrix.android.sdk.api.session.Session
|
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.crypto.model.DeviceInfo
|
||||||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||||
import org.matrix.android.sdk.api.util.toMatrixItem
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
|
@ -322,12 +319,6 @@ class NewHomeDetailFragment :
|
||||||
private fun setupToolbar() {
|
private fun setupToolbar() {
|
||||||
setupToolbar(views.toolbar)
|
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.collapsingToolbar.debouncedClicks(::openSpaceSettings)
|
||||||
views.toolbar.debouncedClicks(::openSpaceSettings)
|
views.toolbar.debouncedClicks(::openSpaceSettings)
|
||||||
|
|
||||||
|
@ -373,9 +364,16 @@ class NewHomeDetailFragment :
|
||||||
vectorPreferences.developerShowDebugInfo()
|
vectorPreferences.developerShowDebugInfo()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
refreshAvatar()
|
||||||
hasUnreadRooms = it.hasUnreadMessages
|
hasUnreadRooms = it.hasUnreadMessages
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun refreshAvatar() = withState(viewModel) { state ->
|
||||||
|
state.myMatrixItem?.let { user ->
|
||||||
|
avatarRenderer.render(user, views.avatar)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onTapToReturnToCall() {
|
override fun onTapToReturnToCall() {
|
||||||
callManager.getCurrentCall()?.let { call ->
|
callManager.getCurrentCall()?.let { call ->
|
||||||
VectorCallActivity.newIntent(
|
VectorCallActivity.newIntent(
|
||||||
|
|
Loading…
Reference in a new issue