[#1303] Refresh transactions immediately

Closes #1303
This commit is contained in:
Honza Rychnovský 2024-03-26 10:56:29 +01:00 committed by GitHub
parent e2eb043afb
commit 8b58233648
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -11,10 +11,8 @@ import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.withContext
import kotlin.time.Duration
import kotlin.time.ExperimentalTime
import kotlin.time.TimeSource
@OptIn(ExperimentalTime::class)
fun <T> Flow<T>.throttle(
duration: Duration,
timeSource: TimeSource = TimeSource.Monotonic

View File

@ -17,6 +17,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import cash.z.ecc.android.sdk.SdkSynchronizer
import cash.z.ecc.android.sdk.Synchronizer
import cash.z.ecc.android.sdk.model.TransactionSubmitResult
import cash.z.ecc.android.sdk.model.UnifiedSpendingKey
@ -174,6 +175,9 @@ internal fun WrapSendConfirmation(
when (result) {
SubmitResult.Success -> {
setStage(SendConfirmationStage.Confirmation)
// Triggering transaction history refreshing to be notified about the newly created
// transaction asap
(synchronizer as SdkSynchronizer).refreshTransactions()
goHome()
}
is SubmitResult.SimpleTrxFailure -> {