File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
BDKSwiftExampleWallet/View Model Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ class WalletViewModel {
9797 ) { [ weak self] notification in
9898 if let progress = notification. userInfo ? [ " progress " ] as? Float {
9999 self ? . updateKyotoProgress ( progress)
100+
101+ // Update sync state based on Kyoto progress
102+ if progress >= 100 {
103+ self ? . walletSyncState = . synced
104+ } else if progress > 0 {
105+ self ? . walletSyncState = . syncing
106+ }
100107 }
101108 }
102109
@@ -107,6 +114,16 @@ class WalletViewModel {
107114 ) { [ weak self] notification in
108115 if let connected = notification. userInfo ? [ " connected " ] as? Bool {
109116 self ? . isKyotoConnected = connected
117+
118+ // When Kyoto connects, update sync state if needed
119+ if connected && self ? . walletSyncState == . notStarted {
120+ // Check current progress to determine state
121+ if let progress = self ? . progress, progress >= 100 {
122+ self ? . walletSyncState = . synced
123+ } else {
124+ self ? . walletSyncState = . syncing
125+ }
126+ }
110127 }
111128 }
112129
You can’t perform that action at this time.
0 commit comments