Skip to content

Commit ead195a

Browse files
committed
fix: avoid TransactionReplaced toast for sent RBF
1 parent d4c3aef commit ead195a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,17 @@ class AppViewModel @Inject constructor(
311311
}
312312

313313
private suspend fun handleOnchainTransactionReplaced(event: Event.OnchainTransactionReplaced) {
314+
// If the replaced transaction was just boosted via RBF from within the app, we already show a
315+
// dedicated boost success toast; suppress the generic "transaction replaced" toast to avoid
316+
// flakiness/noise (notably in E2E flows).
317+
val shouldSuppressReplacedToast = activityRepo
318+
.getOnchainActivityByTxId(event.txid)
319+
?.let { it.isBoosted && it.txType == PaymentType.SENT } == true
320+
314321
activityRepo.handleOnchainTransactionReplaced(event.txid, event.conflicts)
315-
notifyTransactionReplaced(event)
322+
if (!shouldSuppressReplacedToast) {
323+
notifyTransactionReplaced(event)
324+
}
316325
}
317326

318327
private suspend fun handlePaymentFailed(event: Event.PaymentFailed) {

0 commit comments

Comments
 (0)