From 72d2e5b478bc47f1566d7dc6e07c706c6204590b Mon Sep 17 00:00:00 2001 From: Milan Cerovsky Date: Tue, 6 Aug 2024 14:20:50 +0200 Subject: [PATCH] Exchange rate implementation --- .../zcash/ui/common/viewmodel/WalletViewModel.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/WalletViewModel.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/WalletViewModel.kt index 2142c73a..c1c624ec 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/WalletViewModel.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/WalletViewModel.kt @@ -78,6 +78,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.withContext +import kotlin.time.Duration.Companion.minutes import kotlin.time.Duration.Companion.seconds // To make this more multiplatform compatible, we need to remove the dependency on Context @@ -700,5 +701,5 @@ fun Synchronizer.Status.isSyncing() = this == Synchronizer.Status.SYNCING fun Synchronizer.Status.isSynced() = this == Synchronizer.Status.SYNCED -private val USD_EXCHANGE_REFRESH_LOCK_THRESHOLD = 10.seconds -private val USD_EXCHANGE_STALE_LOCK_THRESHOLD = 20.seconds +private val USD_EXCHANGE_REFRESH_LOCK_THRESHOLD = 2.minutes +private val USD_EXCHANGE_STALE_LOCK_THRESHOLD = 15.minutes