Skip to content

Commit eec2635

Browse files
committed
refactor: code cleanup
1 parent 6dc865a commit eec2635

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

app/src/main/java/to/bitkit/ui/screens/wallets/activity/ActivityDetailScreen.kt

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -603,19 +603,32 @@ private fun ActivityDetailContent(
603603
val activity = item.v1
604604
val isActivityEvicted = !activity.doesExist
605605

606-
if (activity.isBoosted && activity.boostTxIds.isNotEmpty()) {
607-
val hasCPFP = activity.boostTxIds.any { boostTxDoesExist[it] == true }
608-
if (hasCPFP) {
606+
// Not boosted → no completed boost
607+
if (!activity.isBoosted) {
608+
false
609+
}
610+
// Boosted but evicted from mempool → show as boosted
611+
else if (isActivityEvicted) {
612+
true
613+
}
614+
// Boosted with CPFP transactions
615+
else if (activity.boostTxIds.isNotEmpty()) {
616+
val hasActiveCPFP = activity.boostTxIds.any { boostTxDoesExist[it] == true }
617+
val hasEvictedBoostTx = activity.boostTxIds.any { boostTxDoesExist[it] == false }
618+
619+
// CPFP exists → boost completed
620+
if (hasActiveCPFP) {
621+
true
622+
}
623+
// SENT tx with evicted boost → show as already boosted
624+
else if (activity.txType == PaymentType.SENT && hasEvictedBoostTx) {
609625
true
610-
} else if (activity.txType == PaymentType.SENT) {
611-
val isAnyBoostTxEvicted = activity.boostTxIds.any { boostTxDoesExist[it] == false }
612-
isAnyBoostTxEvicted
613626
} else {
614627
false
615628
}
616-
} else if (activity.isBoosted && isActivityEvicted) {
617-
true
618-
} else {
629+
}
630+
// Boosted but no boost tx IDs tracked yet
631+
else {
619632
false
620633
}
621634
}

0 commit comments

Comments
 (0)