Skip to content

Commit 7e5a49e

Browse files
committed
Fix onCancel signature and Int optional binding
1 parent c0939b4 commit 7e5a49e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/SprenUI/UI/Screens/Flows/FingerCamera/ResultsScreen.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ struct ResultsScreen: View {
8080
}
8181

8282
// ANS balance
83-
if let ansBalance = results.ansBalance, let intANSBalance = Int(ansBalance) {
84-
ANSBalanceResult(ansBalance: intANSBalance, onInfoButtonTap: { transition(to: .ansBalanceInfo) })
83+
if let ansBalance = results.ansBalance {
84+
ANSBalanceResult(ansBalance: Int(ansBalance), onInfoButtonTap: { transition(to: .ansBalanceInfo) })
8585
}
8686

8787
if results.readiness == nil {

Sources/SprenUI/UI/Screens/SprenUI/SprenUI+Config.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extension SprenUI {
4242
.setupGuide: "SetupGuide"
4343
]
4444

45-
public let onCancel: (() -> Void)
45+
public let onCancel: (() -> Void)?
4646
public let onFinish: ((_ results: Results) -> Void)
4747

4848
// only relevant to demo app
@@ -81,7 +81,7 @@ extension SprenUI {
8181
secondaryColor: Color? = nil,
8282
project: SprenProject,
8383
graphics: [Graphic: String]? = nil,
84-
onCancel: @escaping (() -> Void),
84+
onCancel: (() -> Void)? = nil,
8585
onFinish: @escaping ((Results) -> Void),
8686
logger: Logger? = nil) {
8787
self.baseURL = baseURL

0 commit comments

Comments
 (0)