Skip to content

Commit 456a934

Browse files
committed
fix: calculate total value
1 parent 3bd54bf commit 456a934

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private fun ActivityDetailContent(
205205
.padding(vertical = 16.dp)
206206
) {
207207
BalanceHeaderView(
208-
sats = uiState.paymentValue.toLong(),
208+
sats = uiState.totalValue.toLong(),
209209
prefix = amountPrefix,
210210
showBitcoinSymbol = false,
211211
useSwipeToHide = false,
@@ -638,6 +638,7 @@ private fun PreviewLightningSent() {
638638
isSent = false,
639639
timestamp = (System.currentTimeMillis() / 1000 - 3600).toULong(),
640640
paymentValue = 100000UL,
641+
totalValue = 100000UL,
641642
fee = 500UL,
642643
isSelfSend = false,
643644
isTransfer = false,
@@ -669,6 +670,7 @@ private fun PreviewOnchain() {
669670
isSent = true,
670671
timestamp = (System.currentTimeMillis() / 1000 - 3600).toULong(),
671672
paymentValue = 100000UL,
673+
totalValue = 100000UL,
672674
fee = 500UL,
673675
isSelfSend = false,
674676
isTransfer = false,
@@ -700,6 +702,7 @@ private fun PreviewTransfer() {
700702
isSent = false,
701703
timestamp = (System.currentTimeMillis() / 1000 - 3600).toULong(),
702704
paymentValue = 100000UL,
705+
totalValue = 100000UL,
703706
fee = 500UL,
704707
isSelfSend = false,
705708
isTransfer = true,
@@ -731,7 +734,8 @@ private fun PreviewSelfSend() {
731734
isSent = true,
732735
timestamp = (System.currentTimeMillis() / 1000 - 3600).toULong(),
733736
paymentValue = 0uL,
734-
fee = 500UL,
737+
totalValue = 500uL,
738+
fee = 500uL,
735739
isSelfSend = true,
736740
isTransfer = false,
737741
paymentState = PaymentState.SUCCEEDED,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import to.bitkit.ext.isFinished
1818
import to.bitkit.ext.isSent
1919
import to.bitkit.ext.isTransfer
2020
import to.bitkit.ext.rawId
21+
import to.bitkit.ext.totalValue
2122
import to.bitkit.services.CoreService
2223
import to.bitkit.utils.AddressChecker
2324
import to.bitkit.utils.Logger
@@ -61,6 +62,7 @@ class ActivityDetailViewModel @Inject constructor(
6162
}
6263
},
6364
paymentValue = paymentValue,
65+
totalValue = activity.totalValue(),
6466
fee = when (activity) {
6567
is Activity.Lightning -> activity.v1.fee
6668
is Activity.Onchain -> activity.v1.fee
@@ -169,6 +171,7 @@ sealed interface ActivityDetailScreenState {
169171
val isSent: Boolean,
170172
val timestamp: ULong,
171173
val paymentValue: ULong,
174+
val totalValue: ULong,
172175
val fee: ULong?,
173176
val isSelfSend: Boolean,
174177
val isTransfer: Boolean,

0 commit comments

Comments
 (0)