@@ -64,6 +64,7 @@ import com.wire.kalium.logic.data.sync.SyncState
64
64
import com.wire.kalium.logic.data.user.UserId
65
65
import com.wire.kalium.logic.feature.appVersioning.ObserveIfAppUpdateRequiredUseCase
66
66
import com.wire.kalium.logic.feature.client.ClearNewClientsForUserUseCase
67
+ import com.wire.kalium.logic.feature.client.IsProfileQRCodeDisabledUseCase
67
68
import com.wire.kalium.logic.feature.client.NewClientResult
68
69
import com.wire.kalium.logic.feature.client.ObserveNewClientsUseCase
69
70
import com.wire.kalium.logic.feature.conversation.CheckConversationInviteCodeUseCase
@@ -121,7 +122,8 @@ class WireActivityViewModel @Inject constructor(
121
122
private val observeScreenshotCensoringConfigUseCaseProviderFactory : ObserveScreenshotCensoringConfigUseCaseProvider .Factory ,
122
123
private val globalDataStore : Lazy <GlobalDataStore >,
123
124
private val observeIfE2EIRequiredDuringLoginUseCaseProviderFactory : ObserveIfE2EIRequiredDuringLoginUseCaseProvider .Factory ,
124
- private val workManager : Lazy <WorkManager >
125
+ private val workManager : Lazy <WorkManager >,
126
+ private val isProfileQRCodeDisabled : IsProfileQRCodeDisabledUseCase ,
125
127
) : ActionsViewModel<WireActivityViewAction>() {
126
128
127
129
var globalAppState: GlobalAppState by mutableStateOf(GlobalAppState ())
@@ -327,7 +329,7 @@ class WireActivityViewModel @Inject constructor(
327
329
328
330
is DeepLinkResult .MigrationLogin -> sendAction(OnMigrationLogin (result))
329
331
is DeepLinkResult .OpenConversation -> sendAction(OpenConversation (result))
330
- is DeepLinkResult .OpenOtherUserProfile -> sendAction( OnOpenUserProfile ( result) )
332
+ is DeepLinkResult .OpenOtherUserProfile -> onOpenUserProfileDeepLink( result)
331
333
332
334
DeepLinkResult .SharingIntent -> sendAction(OnShowImportMediaScreen )
333
335
DeepLinkResult .Unknown -> {
@@ -514,6 +516,14 @@ class WireActivityViewModel @Inject constructor(
514
516
}
515
517
}
516
518
519
+ private fun onOpenUserProfileDeepLink (result : DeepLinkResult .OpenOtherUserProfile ) = viewModelScope.launch {
520
+ if (isProfileQRCodeDisabled()) {
521
+ sendAction(ShowToast (R .string.profile_deeplink_feature_unavailable_title_alert))
522
+ } else {
523
+ sendAction(OnOpenUserProfile (result))
524
+ }
525
+ }
526
+
517
527
/* *
518
528
* Reset any unfinished registration process analytics where the user aborted and enabled the registration analytics.
519
529
*/
0 commit comments