Skip to content

Commit d90c22f

Browse files
committed
feat: disable profile qr code feature flag (WPB-20230)
1 parent 73b2bf8 commit d90c22f

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

app/src/main/kotlin/com/wire/android/ui/WireActivityViewModel.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import com.wire.kalium.logic.data.sync.SyncState
6464
import com.wire.kalium.logic.data.user.UserId
6565
import com.wire.kalium.logic.feature.appVersioning.ObserveIfAppUpdateRequiredUseCase
6666
import com.wire.kalium.logic.feature.client.ClearNewClientsForUserUseCase
67+
import com.wire.kalium.logic.feature.client.IsProfileQRCodeDisabledUseCase
6768
import com.wire.kalium.logic.feature.client.NewClientResult
6869
import com.wire.kalium.logic.feature.client.ObserveNewClientsUseCase
6970
import com.wire.kalium.logic.feature.conversation.CheckConversationInviteCodeUseCase
@@ -121,7 +122,8 @@ class WireActivityViewModel @Inject constructor(
121122
private val observeScreenshotCensoringConfigUseCaseProviderFactory: ObserveScreenshotCensoringConfigUseCaseProvider.Factory,
122123
private val globalDataStore: Lazy<GlobalDataStore>,
123124
private val observeIfE2EIRequiredDuringLoginUseCaseProviderFactory: ObserveIfE2EIRequiredDuringLoginUseCaseProvider.Factory,
124-
private val workManager: Lazy<WorkManager>
125+
private val workManager: Lazy<WorkManager>,
126+
private val isProfileQRCodeDisabled: IsProfileQRCodeDisabledUseCase,
125127
) : ActionsViewModel<WireActivityViewAction>() {
126128

127129
var globalAppState: GlobalAppState by mutableStateOf(GlobalAppState())
@@ -327,7 +329,7 @@ class WireActivityViewModel @Inject constructor(
327329

328330
is DeepLinkResult.MigrationLogin -> sendAction(OnMigrationLogin(result))
329331
is DeepLinkResult.OpenConversation -> sendAction(OpenConversation(result))
330-
is DeepLinkResult.OpenOtherUserProfile -> sendAction(OnOpenUserProfile(result))
332+
is DeepLinkResult.OpenOtherUserProfile -> onOpenUserProfileDeepLink(result)
331333

332334
DeepLinkResult.SharingIntent -> sendAction(OnShowImportMediaScreen)
333335
DeepLinkResult.Unknown -> {
@@ -514,6 +516,14 @@ class WireActivityViewModel @Inject constructor(
514516
}
515517
}
516518

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+
517527
/**
518528
* Reset any unfinished registration process analytics where the user aborted and enabled the registration analytics.
519529
*/

app/src/main/kotlin/com/wire/android/ui/userprofile/common/UserProfileInfo.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ import com.wire.android.ui.theme.WireTheme
7979
import com.wire.android.ui.theme.wireColorScheme
8080
import com.wire.android.ui.theme.wireDimensions
8181
import com.wire.android.ui.theme.wireTypography
82-
import com.wire.android.util.debug.FeatureVisibilityFlags.QRCodeEnabled
8382
import com.wire.android.util.debug.LocalFeatureVisibilityFlags
8483
import com.wire.android.util.ifNotEmpty
8584
import com.wire.android.util.ui.PreviewMultipleThemes
@@ -258,7 +257,7 @@ fun UserProfileInfo(
258257
bottom.linkTo(displayName.bottom)
259258
}
260259
) {
261-
if (QRCodeEnabled && showQrCode && isLoading.not()) {
260+
if (showQrCode && isLoading.not()) {
262261
onQrCodeClick?.let { QRCodeIcon(it) }
263262
}
264263
}

app/src/main/kotlin/com/wire/android/util/debug/FeatureVisibilityFlags.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ object FeatureVisibilityFlags {
5656
const val MessageEditIcon = true
5757
const val SearchConversationMessages = true
5858
const val DrawingIcon = true
59-
const val QRCodeEnabled = true
6059
}
6160

6261
val LocalFeatureVisibilityFlags = staticCompositionLocalOf { FeatureVisibilityFlags }

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,4 +1883,6 @@ In group conversations, the group admin can overwrite this setting.</string>
18831883
<string name="failed_attachment_remove">Remove</string>
18841884
<string name="content_description_apply_filter">Apply Filter</string>
18851885
<string name="content_description_filter_files">Filter files</string>
1886+
1887+
<string name="profile_deeplink_feature_unavailable_title_alert">This feature is not available. Please contact your administrator.</string>
18861888
</resources>

0 commit comments

Comments
 (0)