Skip to content

Commit b2be622

Browse files
committed
fix: client progress values are different
1 parent 2877b4b commit b2be622

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

BDKSwiftExampleWallet/Resources/Localizable.xcstrings

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@
146146
}
147147
}
148148
}
149+
},
150+
"%" : {
151+
149152
},
150153
"%@ • %@" : {
151154
"localizations" : {
@@ -210,6 +213,9 @@
210213
}
211214
}
212215
}
216+
},
217+
"%lld" : {
218+
213219
},
214220
"%lld Output%@" : {
215221
"localizations" : {

BDKSwiftExampleWallet/View/Home/ActivityHomeHeaderView.swift

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ struct ActivityHomeHeaderView: View {
3939
.animation(.easeInOut, value: inspectedScripts)
4040
} else if walletSyncState == .syncing {
4141
HStack {
42-
if progress < 1.0 {
43-
if isKyotoClient {
42+
if isKyotoClient {
43+
if progress < 100.0 { // Kyoto progress is percent
4444
if currentBlockHeight > 0 {
4545
Text("Block \(currentBlockHeight)")
4646
.padding(.trailing, -5.0)
@@ -54,30 +54,28 @@ struct ActivityHomeHeaderView: View {
5454
.contentTransition(.numericText())
5555
.transition(.opacity)
5656
}
57-
} else {
58-
Text("\(inspectedScripts)")
59-
.padding(.trailing, -5.0)
60-
.fontWeight(.semibold)
61-
.contentTransition(.numericText())
62-
.transition(.opacity)
63-
64-
Text("/")
65-
.padding(.trailing, -5.0)
66-
.transition(.opacity)
67-
Text("\(totalScripts)")
68-
.contentTransition(.numericText())
69-
.transition(.opacity)
7057
}
58+
} else if progress < 1.0 { // Esplora progress is fraction
59+
Text("\(inspectedScripts)")
60+
.padding(.trailing, -5.0)
61+
.fontWeight(.semibold)
62+
.contentTransition(.numericText())
63+
.transition(.opacity)
64+
65+
Text("/")
66+
.padding(.trailing, -5.0)
67+
.transition(.opacity)
68+
Text("\(totalScripts)")
69+
.contentTransition(.numericText())
70+
.transition(.opacity)
7171
}
7272

7373
if !isKyotoClient || (isKyotoClient && progress > 0) {
74-
Text(
75-
String(
76-
format: "%.0f%%",
77-
progress
78-
)
79-
)
80-
.contentTransition(.numericText())
74+
HStack(spacing: 0) {
75+
Text("\(Int(progress))")
76+
.contentTransition(.numericText())
77+
Text("%")
78+
}
8179
.transition(.opacity)
8280
}
8381
}

0 commit comments

Comments
 (0)