Skip to content

Commit 159f3f5

Browse files
committed
format
1 parent 81fe2ba commit 159f3f5

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

BDKSwiftExampleWallet/App/BDKSwiftExampleWalletApp.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ struct BDKSwiftExampleWalletApp: App {
1313
@AppStorage("isOnboarding") var isOnboarding: Bool = true
1414
@State private var navigationPath = NavigationPath()
1515
@State private var refreshTrigger = UUID()
16-
17-
private var walletExists: Bool {
18-
// Force re-evaluation by reading refreshTrigger and isOnboarding
19-
let _ = refreshTrigger
20-
let _ = isOnboarding
21-
return (try? KeyClient.live.getBackupInfo()) != nil
22-
}
2316

2417
var body: some Scene {
2518
WindowGroup {
@@ -40,3 +33,12 @@ struct BDKSwiftExampleWalletApp: App {
4033
}
4134
}
4235
}
36+
37+
extension BDKSwiftExampleWalletApp {
38+
private var walletExists: Bool {
39+
// Force re-evaluation by reading refreshTrigger and isOnboarding
40+
let _ = refreshTrigger
41+
let _ = isOnboarding
42+
return (try? KeyClient.live.getBackupInfo()) != nil
43+
}
44+
}

BDKSwiftExampleWallet/Service/BDK Service/BDKService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ extension BDKService {
584584
func updateAddressType(_ newAddressType: AddressType) {
585585
let currentType = getCurrentAddressType()
586586
try? keyClient.saveAddressType(newAddressType.description)
587-
587+
588588
// If address type changed, we need a full scan to find transactions with new derivation paths
589589
if currentType != newAddressType {
590590
needsFullScan = true

BDKSwiftExampleWallet/View Model/OnboardingViewModel.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ func withTimeout<T>(seconds: TimeInterval, operation: @escaping () throws -> T)
1616
group.addTask {
1717
return try operation()
1818
}
19-
19+
2020
group.addTask {
2121
try await Task.sleep(nanoseconds: UInt64(seconds * 1_000_000_000))
2222
throw TimeoutError()
2323
}
24-
24+
2525
let result = try await group.next()!
2626
group.cancelAll()
2727
return result
@@ -117,15 +117,15 @@ class OnboardingViewModel: ObservableObject {
117117
}
118118
return
119119
}
120-
120+
121121
guard !isCreatingWallet else {
122122
return
123123
}
124-
124+
125125
DispatchQueue.main.async {
126126
self.isCreatingWallet = true
127127
}
128-
128+
129129
Task {
130130
do {
131131
try await withTimeout(seconds: 30) {
@@ -150,7 +150,9 @@ class OnboardingViewModel: ObservableObject {
150150
} catch is TimeoutError {
151151
DispatchQueue.main.async {
152152
self.isCreatingWallet = false
153-
self.onboardingViewError = .generic(message: "Wallet creation timed out. Please try again.")
153+
self.onboardingViewError = .generic(
154+
message: "Wallet creation timed out. Please try again."
155+
)
154156
}
155157
} catch {
156158
DispatchQueue.main.async {

0 commit comments

Comments
 (0)