Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-13 12:22:50 +02:00
parent 46650fac2c
commit 35253cded5
9 changed files with 79 additions and 69 deletions

View file

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

View file

@ -49,18 +49,15 @@ internal class PushNotificationsModel @Inject constructor(
analyticHandler.send(PushNotificationAnalyticEvents.ButtonAllow(source))
}
override fun onLaterClick(isFromBs: Boolean) {
modelScope.launch {
notificationsRepository.setUserAllowToSubscribeOnPushNotifications(false)
}
override fun onLaterClick() {
analyticHandler.send(PushNotificationAnalyticEvents.ButtonLater(source))
modelScope.launch {
if (isFromBs) {
neverRequestPermissionUseCase(PUSH_PERMISSION)
}
neverRequestPermissionUseCase(PUSH_PERMISSION)
neverToInitiallyAskPermissionUseCase(PUSH_PERMISSION)
params.modelCallbacks.onDenySystemPermission()
if (!params.isBottomSheet) {
if (params.isBottomSheet) {
notificationsRepository.setUserAllowToSubscribeOnPushNotifications(false)
} else {
params.nextRoute?.let { appRouter.push(it) }
}
}

View file

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

View file

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