Skip to content

Commit 16c8252

Browse files
authored
fix: team migration banner sometimes not showing [WPB-17646] (#4045)
1 parent acc61d7 commit 16c8252

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileViewModel.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ class SelfUserProfileViewModel @Inject constructor(
120120
}
121121

122122
suspend fun checkIfUserAbleToMigrateToTeamAccount() {
123-
userProfileState = userProfileState.copy(isAbleToMigrateToTeamAccount = canMigrateFromPersonalToTeam())
123+
val canMigrate = canMigrateFromPersonalToTeam()
124+
userProfileState = userProfileState.copy(isAbleToMigrateToTeamAccount = canMigrate)
124125
}
125126

126127
private suspend fun fetchIsReadOnlyAccount() {
@@ -171,13 +172,15 @@ class SelfUserProfileViewModel @Inject constructor(
171172
// Load user avatar raw image data
172173
completePicture?.let { updateUserAvatar(it) }
173174

175+
val teamUrl = getTeamUrl().takeIf { userType == UserType.OWNER || userType == UserType.ADMIN }
176+
174177
// Update user data state
175178
userProfileState = userProfileState.copy(
176179
status = availabilityStatus,
177180
fullName = name.orEmpty(),
178181
userName = handle.orEmpty(),
179182
teamName = selfTeam?.name,
180-
teamUrl = getTeamUrl().takeIf { userType == UserType.OWNER || userType == UserType.ADMIN },
183+
teamUrl = teamUrl,
181184
otherAccounts = otherAccounts,
182185
avatarAsset = userProfileState.avatarAsset,
183186
isAvatarLoading = false,

0 commit comments

Comments
 (0)