Updated on 2026-08-14
This commit is contained in:
parent
da27e05e0f
commit
fb31d77fb4
2 changed files with 1 additions and 7 deletions
|
|
@ -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 -> {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue