Updated on 2026-08-14

This commit is contained in:
Tangem 2025-07-30 23:19:12 +04:00
parent aa54b0f842
commit 2cbfdb5c66
6 changed files with 36 additions and 23 deletions

View file

@ -7,6 +7,7 @@ import com.tangem.core.decompose.model.ParamsContainer
import com.tangem.core.decompose.navigation.Router
import com.tangem.core.navigation.finisher.AppFinisher
import com.tangem.domain.card.repository.CardRepository
import com.tangem.domain.notifications.GetIsHuaweiDeviceWithoutGoogleServicesUseCase
import com.tangem.domain.notifications.repository.NotificationsRepository
import com.tangem.domain.settings.NeverRequestPermissionUseCase
import com.tangem.domain.settings.NeverToInitiallyAskPermissionUseCase
@ -28,6 +29,8 @@ internal class DisclaimerModel @Inject constructor(
private val neverRequestPermissionUseCase: NeverRequestPermissionUseCase,
private val appFinisher: AppFinisher,
private val notificationsRepository: NotificationsRepository,
private val getIsHuaweiDeviceWithoutGoogleServicesUseCase: GetIsHuaweiDeviceWithoutGoogleServicesUseCase,
paramsContainer: ParamsContainer,
) : Model() {
@ -48,7 +51,8 @@ internal class DisclaimerModel @Inject constructor(
} else {
cardRepository.acceptTangemTOS()
val shouldAskPushPermission = notificationsRepository.shouldShowSubscribeOnNotificationsAfterUpdate()
if (shouldAskPushPermission) {
val isHuaweiDevice = getIsHuaweiDeviceWithoutGoogleServicesUseCase()
if (shouldAskPushPermission && !isHuaweiDevice) {
router.push(AppRoute.PushNotification)
} else {
neverToInitiallyAskPermissionUseCase(PUSH_PERMISSION)