Updated on 2026-08-14

This commit is contained in:
Tangem 2025-08-18 18:06:28 +05:00
parent 9278f6f627
commit c39f617dd6
2 changed files with 8 additions and 13 deletions

View file

@ -1,11 +0,0 @@
package com.tangem.domain.wallets.usecase
import com.tangem.sdk.api.TangemSdkManager
import javax.inject.Inject
class GetIsBiometricsEnabledUseCase @Inject constructor(
private val tangemSdkManager: TangemSdkManager,
) {
operator fun invoke(): Boolean = runCatching(tangemSdkManager::needEnrollBiometrics).getOrNull() ?: false
}

View file

@ -85,7 +85,7 @@ internal class WalletModel @Inject constructor(
private val getWalletsListForEnablingUseCase: GetWalletsForAutomaticallyPushEnablingUseCase,
private val setNotificationsEnabledUseCase: SetNotificationsEnabledUseCase,
private val notificationsFeatureToggles: NotificationsFeatureToggles,
private val getIsBiometryIsEnabledUseCase: GetIsBiometricsEnabledUseCase,
private val shouldSaveUserWalletsSyncUseCase: ShouldSaveUserWalletsSyncUseCase,
private val getIsHuaweiDeviceWithoutGoogleServicesUseCase: GetIsHuaweiDeviceWithoutGoogleServicesUseCase,
val screenLifecycleProvider: ScreenLifecycleProvider,
val innerWalletRouter: InnerWalletRouter,
@ -213,9 +213,15 @@ internal class WalletModel @Inject constructor(
modelScope.launch {
val shouldAskPermission = shouldAskPermissionUseCase(PUSH_PERMISSION)
val afterUpdate = notificationsRepository.shouldShowSubscribeOnNotificationsAfterUpdate()
val isBiometricsEnabled = getIsBiometryIsEnabledUseCase()
val isBiometricsEnabled = shouldSaveUserWalletsSyncUseCase()
val isHuaweiDevice = getIsHuaweiDeviceWithoutGoogleServicesUseCase()
val shouldShowBottomSheet = shouldAskPermission || afterUpdate
Timber.d(
"push BS afterUpdate: $afterUpdate," +
"shouldAskPermission $shouldAskPermission," +
"isBiometricsEnabled $isBiometricsEnabled," +
"isHuaweiDevice $isHuaweiDevice",
)
if (!isBiometricsEnabled) return@launch
if (isHuaweiDevice) return@launch
if (!shouldShowBottomSheet) return@launch