Updated on 2026-08-14
This commit is contained in:
parent
a2b1d3c6c4
commit
45ab6836ad
3 changed files with 2 additions and 29 deletions
|
|
@ -7,7 +7,6 @@ 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
|
||||
|
|
@ -29,8 +28,6 @@ internal class DisclaimerModel @Inject constructor(
|
|||
private val neverRequestPermissionUseCase: NeverRequestPermissionUseCase,
|
||||
private val appFinisher: AppFinisher,
|
||||
private val notificationsRepository: NotificationsRepository,
|
||||
private val getIsHuaweiDeviceWithoutGoogleServicesUseCase: GetIsHuaweiDeviceWithoutGoogleServicesUseCase,
|
||||
|
||||
paramsContainer: ParamsContainer,
|
||||
) : Model() {
|
||||
|
||||
|
|
@ -51,8 +48,7 @@ internal class DisclaimerModel @Inject constructor(
|
|||
} else {
|
||||
cardRepository.acceptTangemTOS()
|
||||
val shouldAskPushPermission = notificationsRepository.shouldShowSubscribeOnNotificationsAfterUpdate()
|
||||
val isHuaweiDevice = getIsHuaweiDeviceWithoutGoogleServicesUseCase()
|
||||
if (shouldAskPushPermission && !isHuaweiDevice) {
|
||||
if (shouldAskPushPermission) {
|
||||
router.push(AppRoute.PushNotification(AppRoute.PushNotification.Source.Stories))
|
||||
} else {
|
||||
neverToInitiallyAskPermissionUseCase(PUSH_PERMISSION)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import com.tangem.domain.models.wallet.UserWallet
|
|||
import com.tangem.domain.nft.DisableWalletNFTUseCase
|
||||
import com.tangem.domain.nft.EnableWalletNFTUseCase
|
||||
import com.tangem.domain.nft.GetWalletNFTEnabledUseCase
|
||||
import com.tangem.domain.notifications.GetIsHuaweiDeviceWithoutGoogleServicesUseCase
|
||||
import com.tangem.domain.notifications.repository.NotificationsRepository
|
||||
import com.tangem.domain.settings.repositories.PermissionRepository
|
||||
import com.tangem.domain.wallets.usecase.*
|
||||
|
|
@ -78,7 +77,6 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
private val settingsManager: SettingsManager,
|
||||
private val permissionsRepository: PermissionRepository,
|
||||
private val notificationsRepository: NotificationsRepository,
|
||||
private val getIsHuaweiDeviceWithoutGoogleServicesUseCase: GetIsHuaweiDeviceWithoutGoogleServicesUseCase,
|
||||
private val isUpgradeWalletNotificationEnabledUseCase: IsUpgradeWalletNotificationEnabledUseCase,
|
||||
private val dismissUpgradeWalletNotificationUseCase: DismissUpgradeWalletNotificationUseCase,
|
||||
private val unlockHotWalletContextualUseCase: UnlockHotWalletContextualUseCase,
|
||||
|
|
@ -130,7 +128,6 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
is UserWallet.Hot -> wallet.backedUp
|
||||
is UserWallet.Cold -> true
|
||||
}
|
||||
val isNeedShowNotifications = !getIsHuaweiDeviceWithoutGoogleServicesUseCase()
|
||||
state.update { value ->
|
||||
value.copy(
|
||||
items = buildItems(
|
||||
|
|
@ -138,7 +135,7 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
cardItem = cardItem,
|
||||
isNFTEnabled = nftEnabled,
|
||||
isNotificationsEnabled = notificationsEnabled,
|
||||
isNotificationsFeatureEnabled = isNeedShowNotifications,
|
||||
isNotificationsFeatureEnabled = true,
|
||||
isNotificationsPermissionGranted = isNotificationsPermissionGranted(),
|
||||
isUpgradeNotificationEnabled = isUpgradeNotificationEnabled,
|
||||
),
|
||||
|
|
@ -274,10 +271,6 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
private fun onCheckedNotificationsChange(isChecked: Boolean) {
|
||||
modelScope.launch {
|
||||
if (isChecked) {
|
||||
if (getIsHuaweiDeviceWithoutGoogleServicesUseCase()) {
|
||||
showHuaweiDialog()
|
||||
return@launch
|
||||
}
|
||||
state.update { value ->
|
||||
value.copy(
|
||||
requestPushNotificationsPermission = true,
|
||||
|
|
@ -290,21 +283,6 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun showHuaweiDialog() {
|
||||
val message = DialogMessage(
|
||||
message = resourceReference(R.string.wallet_settings_push_notifications_huawei_warning),
|
||||
firstActionBuilder = {
|
||||
EventMessageAction(
|
||||
title = resourceReference(R.string.common_ok),
|
||||
warning = true,
|
||||
onClick = {},
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
messageSender.send(message)
|
||||
}
|
||||
|
||||
private fun onNotificationsDescriptionClick() {
|
||||
bottomSheetNavigation.activate(NetworksAvailableForNotificationBSConfig)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,7 +227,6 @@ internal class WalletModel @Inject constructor(
|
|||
"isHuaweiDevice $isHuaweiDevice",
|
||||
)
|
||||
if (!isBiometricsEnabled) return@launch
|
||||
if (isHuaweiDevice) return@launch
|
||||
if (!shouldShowBottomSheet) return@launch
|
||||
|
||||
delay(timeMillis = 1_800)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue