Updated on 2026-08-14

This commit is contained in:
Tangem 2023-01-09 00:35:28 +03:00
parent f968430c59
commit 905792c77e
20 changed files with 384 additions and 197 deletions

View file

@ -4,7 +4,6 @@ import com.tangem.blockchain.common.Wallet
import com.tangem.domain.common.CardDTO
import com.tangem.domain.common.ScanResponse
import com.tangem.tap.common.entities.FiatCurrency
import com.tangem.tap.domain.termsOfUse.CardTou
import org.rekotlin.Action
sealed class DetailsAction : Action {
@ -12,10 +11,8 @@ sealed class DetailsAction : Action {
data class PrepareScreen(
val scanResponse: ScanResponse,
val wallets: List<Wallet>,
val cardTou: CardTou,
) : DetailsAction()
object ShowDisclaimer : DetailsAction()
object ReCreateTwinsWallet : DetailsAction()
sealed class ResetToFactory : DetailsAction() {

View file

@ -61,12 +61,6 @@ class DetailsMiddleware {
is DetailsAction.ResetToFactory -> eraseWalletMiddleware.handle(action)
is DetailsAction.ManageSecurity -> manageSecurityMiddleware.handle(action)
is DetailsAction.AppSettings -> managePrivacyMiddleware.handle(state, action)
is DetailsAction.ShowDisclaimer -> {
val uri = state.cardTermsOfUseUrl
if (uri != null) {
store.dispatch(NavigationAction.OpenDocument(uri))
}
}
is DetailsAction.ReCreateTwinsWallet -> {
store.dispatch(TwinCardsAction.SetMode(CreateTwinWalletMode.RecreateWallet))
store.dispatch(NavigationAction.NavigateTo(AppScreen.OnboardingTwins))

View file

@ -52,7 +52,6 @@ private fun handlePrepareScreen(
return DetailsState(
scanResponse = action.scanResponse,
wallets = action.wallets,
cardTermsOfUseUrl = action.cardTou.getUrl(action.scanResponse.card),
createBackupAllowed = action.scanResponse.card.backupStatus == CardDTO.BackupStatus.NoBackup,
appCurrency = store.state.globalState.appCurrency,
isBiometricsAvailable = tangemSdkManager.canUseBiometry,

View file

@ -1,6 +1,5 @@
package com.tangem.tap.features.details.redux
import android.net.Uri
import com.tangem.blockchain.common.Wallet
import com.tangem.domain.common.CardDTO
import com.tangem.domain.common.ScanResponse
@ -16,7 +15,6 @@ data class DetailsState(
val scanResponse: ScanResponse? = null,
val wallets: List<Wallet> = emptyList(),
val cardSettingsState: CardSettingsState? = null,
val cardTermsOfUseUrl: Uri? = null,
val privacyPolicyUrl: String? = null,
val createBackupAllowed: Boolean = false,
val appCurrency: FiatCurrency = FiatCurrency.Default,

View file

@ -29,7 +29,6 @@ enum class SettingsElement(
AppSettings(R.drawable.ic_settings, R.string.app_settings_title),
LinkMoreCards(R.drawable.ic_more_cards, R.string.details_row_title_create_backup),
TermsOfService(R.drawable.ic_text, R.string.disclaimer_title), // General Terms of Service of the App
TermsOfUse(R.drawable.ic_text, R.string.details_row_title_card_tou), // Terms of Use for S2C cards only
PrivacyPolicy(R.drawable.ic_lock_24, R.string.details_row_privacy_policy);
}

View file

@ -38,7 +38,6 @@ class DetailsViewModel(private val store: Store<AppState>) {
}
SettingsElement.AppSettings -> if (state.isBiometricsAvailable) it else null
SettingsElement.AppCurrency -> if (state.scanResponse?.card?.isMultiwalletAllowed != true) it else null
SettingsElement.TermsOfUse -> if (state.scanResponse?.card?.isStart2Coin == true) it else null
// SettingsElement.ReferralProgram -> if (state.scanResponse?.card?.isTangemWallet == true) it else null
else -> it
}
@ -88,10 +87,7 @@ class DetailsViewModel(private val store: Store<AppState>) {
store.dispatch(DetailsAction.CreateBackup)
}
SettingsElement.TermsOfService -> {
store.dispatch(DisclaimerAction.Show())
}
SettingsElement.TermsOfUse -> {
store.dispatch(DetailsAction.ShowDisclaimer)
store.dispatch(DisclaimerAction.Show(AppScreen.Details))
}
SettingsElement.PrivacyPolicy -> {
// TODO: To be available later