Skip to content

Commit 19a8518

Browse files
committed
organize code
1 parent 37046bf commit 19a8518

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

BDKSwiftExampleWallet/App/BDKSwiftExampleWalletApp.swift

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,24 @@ import SwiftUI
1212
struct BDKSwiftExampleWalletApp: App {
1313
@AppStorage("isOnboarding") var isOnboarding: Bool = true
1414
@State private var navigationPath = NavigationPath()
15-
15+
1616
var body: some Scene {
1717
WindowGroup {
1818
NavigationStack(path: $navigationPath) {
1919
let value = try? KeyClient.live.getBackupInfo()
20-
if isOnboarding && (value == nil) {
21-
OnboardingView(viewModel: .init(bdkClient: .live))
22-
} else if !isOnboarding && (value == nil) {
23-
OnboardingView(viewModel: .init(bdkClient: .live))
20+
if value != nil && !isOnboarding {
21+
HomeView(
22+
viewModel: .init(
23+
bdkClient: .live
24+
),
25+
navigationPath: $navigationPath
26+
)
2427
} else {
25-
HomeView(viewModel: .init(bdkClient: .live), navigationPath: $navigationPath)
28+
OnboardingView(
29+
viewModel: .init(
30+
bdkClient: .live
31+
)
32+
)
2633
}
2734
}
2835
.onChange(of: isOnboarding) { oldValue, newValue in

0 commit comments

Comments
 (0)