File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -270,4 +270,13 @@ class WalletViewModel {
270270 await startSyncWithProgress ( )
271271 }
272272 }
273+
274+ /// Retry sync pipeline for Kyoto when a prior attempt failed.
275+ func retryKyotoSync( ) async {
276+ guard isKyotoClient else { return }
277+ await syncOrFullScan ( )
278+ getBalance ( )
279+ getTransactions ( )
280+ await getPrices ( )
281+ }
273282}
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ struct ActivityHomeHeaderView: View {
1818 let isKyotoConnected : Bool
1919 let currentBlockHeight : UInt32
2020
21+ /// Optional retry action used for Kyoto errors.
22+ let retryKyotoSync : ( ( ) -> Void ) ?
23+
2124 let showAllTransactions : ( ) -> Void
2225
2326 var body : some View {
@@ -116,6 +119,13 @@ struct ActivityHomeHeaderView: View {
116119 }
117120 }
118121 . contentTransition ( . symbolEffect( . replace. offUp) )
122+ . contentShape ( Rectangle ( ) ) // Expand tap target for retry on error
123+ . onTapGesture {
124+ guard isKyotoClient else { return }
125+ if case . error = walletSyncState {
126+ retryKyotoSync ? ( )
127+ }
128+ }
119129
120130 }
121131 . foregroundStyle ( . secondary)
Original file line number Diff line number Diff line change @@ -54,7 +54,12 @@ struct WalletView: View {
5454 needsFullScan: viewModel. needsFullScan,
5555 isKyotoClient: viewModel. isKyotoClient,
5656 isKyotoConnected: viewModel. isKyotoConnected,
57- currentBlockHeight: viewModel. currentBlockHeight
57+ currentBlockHeight: viewModel. currentBlockHeight,
58+ retryKyotoSync: {
59+ Task {
60+ await viewModel. retryKyotoSync ( )
61+ }
62+ }
5863 ) {
5964 showAllTransactions = true
6065 }
You can’t perform that action at this time.
0 commit comments