File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Bitkit/Views/Wallets/Activity Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ struct ActivityExplorerView: View {
88 @EnvironmentObject var app : AppViewModel
99 @EnvironmentObject var currency : CurrencyViewModel
1010
11+ @State private var txDetails : TxDetails ?
12+ @State private var isLoadingTransaction = false
13+
1114 private var onchain : OnchainActivity ? {
1215 guard case let . onchain( activity) = item else { return nil }
1316 return activity
@@ -32,6 +35,24 @@ struct ActivityExplorerView: View {
3235 return URL ( string: " \( baseUrl) /tx/ \( txId) " )
3336 }
3437
38+ private func loadTransactionDetails( ) async {
39+ guard let onchain else { return }
40+
41+ isLoadingTransaction = true
42+
43+ do {
44+ let details = try await AddressChecker . getTransaction ( txid: onchain. txId)
45+ await MainActor . run {
46+ txDetails = details
47+ isLoadingTransaction = false
48+ }
49+ } catch {
50+ await MainActor . run {
51+ isLoadingTransaction = false
52+ }
53+ }
54+ }
55+
3556 private var amountPrefix : String {
3657 switch item {
3758 case let . lightning( activity) :
@@ -156,6 +177,11 @@ struct ActivityExplorerView: View {
156177 . navigationBarHidden ( true )
157178 . padding ( . horizontal, 16 )
158179 . bottomSafeAreaPadding ( )
180+ . task {
181+ if onchain != nil {
182+ await loadTransactionDetails ( )
183+ }
184+ }
159185 }
160186}
161187
You can’t perform that action at this time.
0 commit comments