Updated on 2026-08-14

This commit is contained in:
Tangem 2023-10-04 13:32:04 +03:00
parent bae36dfbf5
commit 21d70dce7c
7 changed files with 0 additions and 72 deletions

View file

@ -5,9 +5,6 @@ import com.tangem.core.ui.extensions.TextReference
@Immutable
internal sealed class WalletAlertState {
data class WalletAlreadySignedHashes(val onUnderstandClick: () -> Unit) : WalletAlertState()
data class DefaultAlert(
val title: TextReference,
val message: TextReference,

View file

@ -20,7 +20,5 @@ internal sealed class WalletEvent {
data class CopyAddress(val address: String) : WalletEvent()
data class ShowWalletAlreadySignedHashesMessage(val onUnderstandClick: () -> Unit) : WalletEvent()
data class RateApp(val onDismissClick: () -> Unit) : WalletEvent()
}

View file

@ -11,32 +11,12 @@ import com.tangem.feature.wallet.presentation.wallet.state.WalletAlertState
@Composable
internal fun WalletAlert(config: WalletAlertState, onDismiss: () -> Unit) {
when (config) {
is WalletAlertState.WalletAlreadySignedHashes -> {
WalletAlreadySignedHashesAlert(config = config, onDismiss = onDismiss)
}
is WalletAlertState.DefaultAlert -> {
DefaultAlert(config = config, onDismiss = onDismiss)
}
}
}
@Composable
private fun WalletAlreadySignedHashesAlert(config: WalletAlertState.WalletAlreadySignedHashes, onDismiss: () -> Unit) {
BasicDialog(
message = stringResource(id = R.string.alert_signed_hashes_message),
confirmButton = DialogButton(
title = stringResource(id = R.string.common_understand),
onClick = {
config.onUnderstandClick()
onDismiss()
},
),
onDismissDialog = onDismiss,
title = stringResource(id = R.string.warning_important_security_info, "\u26A0"),
dismissButton = DialogButton(title = stringResource(id = R.string.common_cancel), onClick = onDismiss),
)
}
@Composable
private fun DefaultAlert(config: WalletAlertState.DefaultAlert, onDismiss: () -> Unit) {
val confirmButton: DialogButton

View file

@ -47,11 +47,6 @@ internal fun WalletEventEffect(
is WalletEvent.CopyAddress -> {
clipboardManager.setText(AnnotatedString(value.address))
}
is WalletEvent.ShowWalletAlreadySignedHashesMessage -> {
onAlertConfigSet(
WalletAlertState.WalletAlreadySignedHashes(onUnderstandClick = value.onUnderstandClick),
)
}
is WalletEvent.ShowAlert -> {
onAlertConfigSet(
WalletAlertState.DefaultAlert(

View file

@ -17,8 +17,6 @@ internal interface WalletClickIntents {
fun onBackupCardClick()
fun onMultiWalletSignedHashesNotificationClick()
fun onLikeAppClick()
fun onDislikeAppClick()

View file

@ -137,28 +137,6 @@ internal class WalletNotificationsListFactory(
element = WalletNotification.Warning.SomeNetworksUnreachable,
condition = cryptoCurrencyList.hasUnreachableNetworks(),
)
if (cardTypesResolver.isBackupForbidden()) {
addIf(
element = WalletNotification.Warning.NumberOfSignedHashesIncorrect,
condition = checkSignedHashes(
cardTypesResolver = cardTypesResolver,
isDemo = isDemo,
wasCardScanned,
),
)
} else {
addIf(
element = WalletNotification.Warning.MultiWalletSignedHashesIncorrect(
onClick = clickIntents::onMultiWalletSignedHashesNotificationClick,
),
condition = checkSignedHashes(
cardTypesResolver = cardTypesResolver,
isDemo = isDemo,
wasCardScanned,
),
)
}
} else {
addIf(
element = WalletNotification.Warning.NetworksUnreachable,

View file

@ -406,24 +406,6 @@ internal class WalletViewModel @Inject constructor(
router.openOnboardingScreen()
}
override fun onMultiWalletSignedHashesNotificationClick() {
val state = uiState as? WalletState.ContentState ?: return
uiState = stateFactory.getStateAndTriggerEvent(
state = uiState,
event = WalletEvent.ShowWalletAlreadySignedHashesMessage(
onUnderstandClick = {
viewModelScope.launch(dispatchers.main) {
setCardWasScannedUseCase(
cardId = getWallet(index = state.walletsListConfig.selectedWalletIndex).cardId,
)
}
},
),
setUiState = { uiState = it },
)
}
override fun onLikeAppClick() {
analyticsEventsHandler.send(WalletScreenAnalyticsEvent.NoticeRateAppButton(AnalyticsParam.RateApp.Liked))
uiState = stateFactory.getStateAndTriggerEvent(