Updated on 2026-08-14

This commit is contained in:
Tangem 2022-04-20 13:10:32 +03:00
commit f8cccf4482
4 changed files with 16 additions and 1 deletions

View file

@ -91,6 +91,8 @@ sealed class WalletAction : Action {
}
class CheckRemainingSignatures(val remainingSignatures: Int?) : Warnings()
object RestoreFundsWarningClosed : Warnings()
}
data class LoadFiatRate(

View file

@ -66,6 +66,9 @@ class WarningsMiddleware {
)
}
}
is WalletAction.Warnings.RestoreFundsWarningClosed -> {
preferencesStorage.saveRestoreFundsWarningClosed()
}
}
}
@ -90,7 +93,7 @@ class WarningsMiddleware {
addWarningMessage(WarningMessagesManager.testCardWarning(), autoUpdate = true)
return@let
}
if (card.useOldStyleDerivation) {
if (card.useOldStyleDerivation && !preferencesStorage.wasRestoreFundsWarningClosed()) {
addWarningMessage(warning = WarningMessagesManager.restoreFundsWarning())
}

View file

@ -96,6 +96,7 @@ class WarningMessageVH(val binding: LayoutWarningBinding) : RecyclerView.ViewHol
binding.btnClose.show()
binding.btnClose.setOnClickListener {
store.dispatch(GlobalAction.HideWarningMessage(warning))
store.dispatch(WalletAction.Warnings.RestoreFundsWarningClosed)
}
val locale = ConfigurationCompat
.getLocales(Resources.getSystem().configuration)

View file

@ -64,12 +64,21 @@ class PreferencesStorage(applicationContext: Application) {
preferences.edit { putInt(APP_LAUNCH_COUNT_KEY, ++count) }
}
fun wasRestoreFundsWarningClosed(): Boolean {
return preferences.getBoolean(RESTORE_FUNDS_CLOSED_KEY, false)
}
fun saveRestoreFundsWarningClosed() {
preferences.edit { putBoolean(RESTORE_FUNDS_CLOSED_KEY, true) }
}
companion object {
private const val PREFERENCES_NAME = "tapPrefs"
private const val APP_CURRENCY_KEY = "appCurrency"
private const val DISCLAIMER_ACCEPTED_KEY = "disclaimerAccepted"
private const val TWINS_ONBOARDING_SHOWN_KEY = "twinsOnboardingShown"
private const val APP_LAUNCH_COUNT_KEY = "launchCount"
private const val RESTORE_FUNDS_CLOSED_KEY = "restoreFundsClosed"
}
}