File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
BDKSwiftExampleWallet/View Model Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,11 @@ class WalletViewModel {
110
110
if self . bdkClient. getClientType ( ) != . kyoto { return }
111
111
if let progress = notification. userInfo ? [ " progress " ] as? Float {
112
112
self . updateKyotoProgress ( progress)
113
+ // Consider any progress update as evidence of an active connection
114
+ // so the UI does not falsely show a red disconnected indicator while syncing.
115
+ if progress > 0 {
116
+ self . isKyotoConnected = true
117
+ }
113
118
114
119
// Update sync state based on Kyoto progress
115
120
if progress >= 100 {
@@ -150,6 +155,8 @@ class WalletViewModel {
150
155
if self . bdkClient. getClientType ( ) != . kyoto { return }
151
156
if let height = notification. userInfo ? [ " height " ] as? UInt32 {
152
157
self . currentBlockHeight = height
158
+ // Receiving chain height implies we have peer connectivity
159
+ self . isKyotoConnected = true
153
160
// Auto-refresh wallet data when Kyoto receives new blocks
154
161
self . getBalance ( )
155
162
self . getTransactions ( )
You can’t perform that action at this time.
0 commit comments