Updated on 2026-08-14

This commit is contained in:
Tangem 2020-11-18 13:12:47 +03:00
parent da27e05e0f
commit fb31d77fb4
2 changed files with 1 additions and 7 deletions

View file

@ -25,7 +25,7 @@ class HomeMiddleware {
when (action) {
is HomeAction.CheckIfFirstLaunch -> {
store.dispatch(
HomeAction.CheckIfFirstLaunch.Result(preferencesStorage.isFirstLaunch())
HomeAction.CheckIfFirstLaunch.Result(preferencesStorage.getCountOfLaunches() == 1)
)
}
is HomeAction.ReadCard -> {

View file

@ -50,12 +50,6 @@ class PreferencesStorage(applicationContext: Application) {
return preferences.edit().putString(FIAT_CURRENCIES_KEY, json).apply()
}
fun isFirstLaunch(): Boolean {
val isFirst = !preferences.contains(FIRST_LAUNCH_CHECK_KEY)
if (isFirst) preferences.edit().putInt(FIRST_LAUNCH_CHECK_KEY, System.currentTimeMillis().toInt()).apply()
return isFirst
}
fun getCountOfLaunches(): Int = preferences.getInt(APP_LAUNCH_COUNT_KEY, 1)
fun saveScannedCardId(cardId: String) {