Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-06 17:51:19 +02:00
parent d5fcf732e5
commit a8e621c2c4
4 changed files with 9 additions and 8 deletions

View file

@ -3,7 +3,7 @@ package com.tangem.features.pushnotifications.impl.model
internal interface PushNotificationsClickIntents { internal interface PushNotificationsClickIntents {
fun onAllowClick() fun onAllowClick()
fun onLaterClick() fun onLaterClick(isFromBs: Boolean)
fun onAllowPermission() fun onAllowPermission()

View file

@ -46,17 +46,18 @@ internal class PushNotificationsModel @Inject constructor(
modelScope.launch { modelScope.launch {
notificationsRepository.setUserAllowToSubscribeOnPushNotifications(true) notificationsRepository.setUserAllowToSubscribeOnPushNotifications(true)
} }
analyticHandler.send(PushNotificationAnalyticEvents.ButtonAllow(source)) analyticHandler.send(PushNotificationAnalyticEvents.ButtonAllow(source))
} }
override fun onLaterClick() { override fun onLaterClick(isFromBs: Boolean) {
modelScope.launch { modelScope.launch {
notificationsRepository.setUserAllowToSubscribeOnPushNotifications(false) notificationsRepository.setUserAllowToSubscribeOnPushNotifications(false)
} }
analyticHandler.send(PushNotificationAnalyticEvents.ButtonLater(source)) analyticHandler.send(PushNotificationAnalyticEvents.ButtonLater(source))
modelScope.launch { modelScope.launch {
if (isFromBs) {
neverRequestPermissionUseCase(PUSH_PERMISSION) neverRequestPermissionUseCase(PUSH_PERMISSION)
}
neverToInitiallyAskPermissionUseCase(PUSH_PERMISSION) neverToInitiallyAskPermissionUseCase(PUSH_PERMISSION)
params.modelCallbacks.onDenySystemPermission() params.modelCallbacks.onDenySystemPermission()
if (!params.isBottomSheet) { if (!params.isBottomSheet) {

View file

@ -41,7 +41,7 @@ internal fun PushNotificationsBottomSheet(config: TangemBottomSheetConfig, conte
@Composable @Composable
internal fun PushNotificationsContent( internal fun PushNotificationsContent(
onAllowClick: () -> Unit, onAllowClick: () -> Unit,
onLaterClick: () -> Unit, onLaterClick: (isFromBs: Boolean) -> Unit,
onAllowPermission: () -> Unit, onAllowPermission: () -> Unit,
onDenyPermission: () -> Unit, onDenyPermission: () -> Unit,
) { ) {
@ -78,7 +78,7 @@ internal fun PushNotificationsContent(
}, },
secondaryButtonText = resourceReference(R.string.common_later), secondaryButtonText = resourceReference(R.string.common_later),
onSecondaryClick = { onSecondaryClick = {
onLaterClick() onLaterClick(true)
}, },
) )
} }

View file

@ -15,7 +15,7 @@ import kotlinx.collections.immutable.persistentListOf
@Composable @Composable
internal fun PushNotificationsScreen( internal fun PushNotificationsScreen(
onAllowClick: () -> Unit, onAllowClick: () -> Unit,
onLaterClick: () -> Unit, onLaterClick: (isFromBs: Boolean) -> Unit,
onAllowPermission: () -> Unit, onAllowPermission: () -> Unit,
onDenyPermission: () -> Unit, onDenyPermission: () -> Unit,
) { ) {
@ -50,7 +50,7 @@ internal fun PushNotificationsScreen(
secondaryButton = ShowcaseButtonModel( secondaryButton = ShowcaseButtonModel(
buttonText = resourceReference(R.string.common_later), buttonText = resourceReference(R.string.common_later),
onClick = { onClick = {
onLaterClick() onLaterClick(false)
}, },
), ),
modifier = Modifier.systemBarsPadding(), modifier = Modifier.systemBarsPadding(),