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 {
97
97
) { [ weak self] notification in
98
98
if let progress = notification. userInfo ? [ " progress " ] as? Float {
99
99
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
+ }
100
107
}
101
108
}
102
109
@@ -107,6 +114,16 @@ class WalletViewModel {
107
114
) { [ weak self] notification in
108
115
if let connected = notification. userInfo ? [ " connected " ] as? Bool {
109
116
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
+ }
110
127
}
111
128
}
112
129
You can’t perform that action at this time.
0 commit comments