File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
app/src/main/java/to/bitkit
ui/screens/wallets/activity Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,14 @@ fun Activity.Onchain.boostType() = when (this.v1.txType) {
7171 PaymentType .RECEIVED -> BoostType .CPFP
7272}
7373
74+ fun Activity.timestamp () = when (this ) {
75+ is Activity .Lightning -> v1.timestamp
76+ is Activity .Onchain -> when (v1.confirmed) {
77+ true -> v1.confirmTimestamp ? : v1.timestamp
78+ else -> v1.timestamp
79+ }
80+ }
81+
7482enum class BoostType { RBF , CPFP }
7583
7684@Suppress(" LongParameterList" )
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ import to.bitkit.ext.ellipsisMiddle
5252import to.bitkit.ext.isSent
5353import to.bitkit.ext.isTransfer
5454import to.bitkit.ext.rawId
55+ import to.bitkit.ext.timestamp
5556import to.bitkit.ext.toActivityItemDate
5657import to.bitkit.ext.toActivityItemTime
5758import to.bitkit.ext.totalValue
@@ -303,13 +304,7 @@ private fun ActivityDetailContent(
303304 }
304305
305306 val amountPrefix = if (isSent) " -" else " +"
306- val timestamp = when (item) {
307- is Activity .Lightning -> item.v1.timestamp
308- is Activity .Onchain -> when (item.v1.confirmed) {
309- true -> item.v1.confirmTimestamp ? : item.v1.timestamp
310- else -> item.v1.timestamp
311- }
312- }
307+ val timestamp = item.timestamp()
313308 val paymentValue = when (item) {
314309 is Activity .Lightning -> item.v1.value
315310 is Activity .Onchain -> item.v1.value
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import to.bitkit.ext.formatted
3434import to.bitkit.ext.isSent
3535import to.bitkit.ext.isTransfer
3636import to.bitkit.ext.rawId
37+ import to.bitkit.ext.timestamp
3738import to.bitkit.ext.totalValue
3839import to.bitkit.ext.txType
3940import to.bitkit.models.PrimaryDisplay
@@ -66,10 +67,7 @@ fun ActivityRow(
6667 is Activity .Onchain -> null
6768 }
6869 val isLightning = item is Activity .Lightning
69- val timestamp = when (item) {
70- is Activity .Lightning -> item.v1.timestamp
71- is Activity .Onchain -> item.v1.timestamp
72- }
70+ val timestamp = item.timestamp()
7371 val txType: PaymentType = item.txType()
7472 val isSent = item.isSent()
7573 val amountPrefix = if (isSent) " -" else " +"
You can’t perform that action at this time.
0 commit comments