From b562767e77d77069f76d0b7f7fecdd8b312c3230 Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 24 Nov 2025 08:26:47 -0600 Subject: [PATCH] feat: add kyoto retry (hooked into pull to refresh) --- BDKSwiftExampleWallet/View Model/WalletViewModel.swift | 9 +++++++++ BDKSwiftExampleWallet/View/WalletView.swift | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/BDKSwiftExampleWallet/View Model/WalletViewModel.swift b/BDKSwiftExampleWallet/View Model/WalletViewModel.swift index 9001d8ae..629412e5 100644 --- a/BDKSwiftExampleWallet/View Model/WalletViewModel.swift +++ b/BDKSwiftExampleWallet/View Model/WalletViewModel.swift @@ -270,4 +270,13 @@ class WalletViewModel { await startSyncWithProgress() } } + + /// Retry Kyoto sync and refresh cached data. + func retryKyotoSync() async { + guard isKyotoClient else { return } + await syncOrFullScan() + getBalance() + getTransactions() + await getPrices() + } } diff --git a/BDKSwiftExampleWallet/View/WalletView.swift b/BDKSwiftExampleWallet/View/WalletView.swift index 495f9cfe..d4898160 100644 --- a/BDKSwiftExampleWallet/View/WalletView.swift +++ b/BDKSwiftExampleWallet/View/WalletView.swift @@ -79,9 +79,7 @@ struct WalletView: View { } .refreshable { if viewModel.isKyotoClient { - viewModel.getBalance() - viewModel.getTransactions() - await viewModel.getPrices() + await viewModel.retryKyotoSync() } else { await viewModel.syncOrFullScan() viewModel.getBalance()