Updated on 2026-08-14

This commit is contained in:
Tangem 2022-12-20 11:37:56 +03:00
parent 0fc6a98186
commit f292e469bb
4 changed files with 8 additions and 0 deletions

View file

@ -8,6 +8,7 @@ import com.tangem.tap.common.analytics.events.Settings
import com.tangem.tap.common.redux.AppState
import com.tangem.tap.features.details.redux.CardSettingsState
import com.tangem.tap.features.details.redux.DetailsAction
import com.tangem.wallet.R
import org.rekotlin.Store
class CardSettingsViewModel(private val store: Store<AppState>) {

View file

@ -37,6 +37,7 @@ fun ResetCardScreen(state: ResetCardScreenState, onBackPressed: () -> Unit) {
SettingsScreensScaffold(
content = { ResetCardView(state = state) },
onBackClick = onBackPressed,
backgroundColor = Color.Transparent,
)
}

View file

@ -3,6 +3,7 @@ package com.tangem.tap.features.details.ui.resetcard
import com.tangem.tap.features.details.ui.cardsettings.TextReference
data class ResetCardScreenState(
@StringRes val descriptionResId: Int,
val accepted: Boolean = false,
val descriptionText: TextReference,
val onAcceptWarningToggleClick: (Boolean) -> Unit,

View file

@ -15,6 +15,11 @@ class ResetCardViewModel(private val store: Store<AppState>) {
?: TextReference.Str(value = "")
return ResetCardScreenState(
descriptionResId = if (state?.card?.backupStatus?.isActive == true) {
R.string.reset_card_with_backup_to_factory_message
} else {
R.string.reset_card_without_backup_to_factory_message
},
accepted = state?.resetConfirmed ?: false,
descriptionText = descriptionText,
onAcceptWarningToggleClick = { store.dispatch(DetailsAction.ResetToFactory.Confirm(it)) },