Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-19 16:57:19 +05:00
parent e0fe8be558
commit 71e4d3a6ed
4 changed files with 9 additions and 14 deletions

View file

@ -40,7 +40,6 @@ import com.tangem.domain.card.repository.CardSdkConfigRepository
import com.tangem.domain.common.wallets.UserWalletsListRepository
import com.tangem.domain.settings.SetGooglePayAvailabilityUseCase
import com.tangem.domain.settings.SetGoogleServicesAvailabilityUseCase
import com.tangem.domain.settings.ShouldInitiallyAskPermissionUseCase
import com.tangem.domain.settings.repositories.SettingsRepository
import com.tangem.domain.staking.SendUnsubmittedHashesUseCase
import com.tangem.domain.wallets.legacy.UserWalletsListManager
@ -130,9 +129,6 @@ class MainActivity : AppCompatActivity(), ActivityResultCallbackHolder {
@Inject
lateinit var cardRepository: CardRepository
@Inject
lateinit var shouldInitiallyAskPermissionUseCase: ShouldInitiallyAskPermissionUseCase
@Inject
lateinit var backupServiceHolder: BackupServiceHolder

View file

@ -38,6 +38,7 @@ dependencies {
implementation(projects.domain.feedback)
implementation(projects.domain.feedback.models)
implementation(projects.domain.hotWallet)
implementation(projects.domain.notifications)
/** Common */
implementation(projects.common.ui)

View file

@ -15,8 +15,8 @@ import com.tangem.core.ui.extensions.resourceReference
import com.tangem.core.ui.message.DialogMessage
import com.tangem.core.ui.message.EventMessageAction
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.settings.ShouldAskPermissionUseCase
import com.tangem.domain.hotwallet.SetAccessCodeSkippedUseCase
import com.tangem.domain.notifications.repository.NotificationsRepository
import com.tangem.domain.wallets.analytics.WalletSettingsAnalyticEvents
import com.tangem.features.hotwallet.addexistingwallet.entry.routing.AddExistingWalletRoute
import com.tangem.features.hotwallet.addexistingwallet.im.port.AddExistingWalletImportComponent
@ -25,7 +25,6 @@ import com.tangem.features.hotwallet.accesscode.AccessCodeComponent
import com.tangem.features.hotwallet.setupfinished.MobileWalletSetupFinishedComponent
import com.tangem.features.hotwallet.stepper.api.HotWalletStepperComponent
import com.tangem.features.pushnotifications.api.PushNotificationsModelCallbacks
import com.tangem.features.pushnotifications.api.utils.PUSH_PERMISSION
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.flow.MutableStateFlow
@ -37,7 +36,7 @@ import javax.inject.Inject
internal class AddExistingWalletModel @Inject constructor(
override val dispatchers: CoroutineDispatcherProvider,
private val router: Router,
private val shouldAskPermissionUseCase: ShouldAskPermissionUseCase,
private val notificationsRepository: NotificationsRepository,
@GlobalUiMessageSender private val uiMessageSender: UiMessageSender,
private val trackingContextProxy: TrackingContextProxy,
private val setAccessCodeSkippedUseCase: SetAccessCodeSkippedUseCase,
@ -79,8 +78,8 @@ internal class AddExistingWalletModel @Inject constructor(
private fun navigateToPushNotificationsOrNext() {
modelScope.launch {
val shouldRequestPush = shouldAskPermissionUseCase(PUSH_PERMISSION)
if (shouldRequestPush) {
val shouldAskNotificationPermissions = notificationsRepository.shouldAskNotificationPermissionsViaBs()
if (shouldAskNotificationPermissions) {
stackNavigation.replaceAll(AddExistingWalletRoute.PushNotifications)
} else {
stackNavigation.replaceAll(AddExistingWalletRoute.SetupFinished)

View file

@ -18,8 +18,8 @@ import com.tangem.core.ui.extensions.resourceReference
import com.tangem.core.ui.message.DialogMessage
import com.tangem.core.ui.message.EventMessageAction
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.settings.ShouldAskPermissionUseCase
import com.tangem.domain.hotwallet.SetAccessCodeSkippedUseCase
import com.tangem.domain.notifications.repository.NotificationsRepository
import com.tangem.domain.wallets.analytics.WalletSettingsAnalyticEvents
import com.tangem.features.hotwallet.manualbackup.check.ManualBackupCheckComponent
import com.tangem.features.hotwallet.manualbackup.completed.ManualBackupCompletedComponent
@ -28,7 +28,6 @@ import com.tangem.features.hotwallet.manualbackup.start.ManualBackupStartCompone
import com.tangem.features.hotwallet.accesscode.AccessCodeComponent
import com.tangem.features.hotwallet.setupfinished.MobileWalletSetupFinishedComponent
import com.tangem.features.hotwallet.walletactivation.entry.routing.WalletActivationRoute
import com.tangem.features.pushnotifications.api.utils.PUSH_PERMISSION
import com.tangem.features.hotwallet.WalletActivationComponent
import com.tangem.features.hotwallet.stepper.api.HotWalletStepperComponent
import com.tangem.features.pushnotifications.api.PushNotificationsModelCallbacks
@ -44,7 +43,7 @@ internal class WalletActivationModel @Inject constructor(
paramsContainer: ParamsContainer,
override val dispatchers: CoroutineDispatcherProvider,
private val router: Router,
private val shouldAskPermissionUseCase: ShouldAskPermissionUseCase,
private val notificationsRepository: NotificationsRepository,
private val setAccessCodeSkippedUseCase: SetAccessCodeSkippedUseCase,
@GlobalUiMessageSender private val uiMessageSender: UiMessageSender,
private val trackingContextProxy: TrackingContextProxy,
@ -118,8 +117,8 @@ internal class WalletActivationModel @Inject constructor(
private fun navigateToPushNotificationsOrNext() {
modelScope.launch {
val shouldRequestPush = shouldAskPermissionUseCase(PUSH_PERMISSION)
if (shouldRequestPush) {
val shouldAskNotificationPermissions = notificationsRepository.shouldAskNotificationPermissionsViaBs()
if (shouldAskNotificationPermissions) {
stackNavigation.replaceAll(WalletActivationRoute.PushNotifications)
} else {
stackNavigation.replaceAll(WalletActivationRoute.SetupFinished)