Skip to content

Commit 9b2542f

Browse files
authored
ui: animation delay for less scripts
1 parent 5c8b813 commit 9b2542f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

BDKSwiftExampleWallet/View Model/WalletViewModel.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@ class WalletSyncScriptInspector: SyncScriptInspector {
164164
func inspect(script: Script, total: UInt64) {
165165
totalCount = total
166166
inspectedCount += 1
167+
168+
let delay: TimeInterval =
169+
if total <= 5 {
170+
0.2
171+
} else if total < 10 {
172+
0.15
173+
} else if total < 20 {
174+
0.1
175+
} else {
176+
0
177+
}
178+
Thread.sleep(forTimeInterval: delay)
167179
updateProgress(inspectedCount, totalCount)
168180
}
169181
}

0 commit comments

Comments
 (0)