File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,16 @@ class WalletViewModel {
51
51
private var updateProgress : @Sendable ( UInt64 , UInt64 ) -> Void {
52
52
{ [ weak self] inspected, total in
53
53
DispatchQueue . main. async {
54
+ // When using Kyoto, progress is provided separately as percent
55
+ if self ? . isKyotoClient == true { return }
54
56
self ? . totalScripts = total
55
57
self ? . inspectedScripts = inspected
56
- self ? . progress = total > 0 ? Float ( inspected) / Float( total) : 0
58
+ let fraction = total > 0 ? Float ( inspected) / Float( total) : 0
59
+ self ? . progress = fraction
60
+ #if DEBUG
61
+ let percent = Int ( ( fraction * 100 ) . rounded ( ) )
62
+ print ( " [Esplora][VM] inspected= \( inspected) / \( total) fraction= \( String ( format: " %.4f " , fraction) ) percent= \( percent) % " )
63
+ #endif
57
64
}
58
65
}
59
66
}
@@ -65,6 +72,9 @@ class WalletViewModel {
65
72
let progressPercent = UInt64 ( progress)
66
73
self ? . inspectedScripts = progressPercent
67
74
self ? . totalScripts = 100
75
+ #if DEBUG
76
+ print ( " [Kyoto][VM] percent= \( Int ( progress) ) % " )
77
+ #endif
68
78
}
69
79
}
70
80
}
Original file line number Diff line number Diff line change @@ -71,8 +71,11 @@ struct ActivityHomeHeaderView: View {
71
71
}
72
72
73
73
if !isKyotoClient || ( isKyotoClient && progress > 0 ) {
74
+ let percent : Int = isKyotoClient
75
+ ? Int ( progress. rounded ( ) )
76
+ : Int ( ( progress * 100 ) . rounded ( ) )
74
77
HStack ( spacing: 0 ) {
75
- Text ( " \( Int ( progress ) ) " )
78
+ Text ( " \( percent ) " )
76
79
. contentTransition ( . numericText( ) )
77
80
Text ( " % " )
78
81
}
You can’t perform that action at this time.
0 commit comments