Skip to content

Commit b562767

Browse files
committed
feat: add kyoto retry (hooked into pull to refresh)
1 parent 884c955 commit b562767

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

BDKSwiftExampleWallet/View Model/WalletViewModel.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,13 @@ class WalletViewModel {
270270
await startSyncWithProgress()
271271
}
272272
}
273+
274+
/// Retry Kyoto sync and refresh cached data.
275+
func retryKyotoSync() async {
276+
guard isKyotoClient else { return }
277+
await syncOrFullScan()
278+
getBalance()
279+
getTransactions()
280+
await getPrices()
281+
}
273282
}

BDKSwiftExampleWallet/View/WalletView.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ struct WalletView: View {
7979
}
8080
.refreshable {
8181
if viewModel.isKyotoClient {
82-
viewModel.getBalance()
83-
viewModel.getTransactions()
84-
await viewModel.getPrices()
82+
await viewModel.retryKyotoSync()
8583
} else {
8684
await viewModel.syncOrFullScan()
8785
viewModel.getBalance()

0 commit comments

Comments
 (0)