Skip to content

Commit 38f72e5

Browse files
authored
refactor: walletview load
1 parent 5a741d0 commit 38f72e5

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

BDKSwiftExampleWallet/Resources/Localizable.xcstrings

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,10 @@
760760
},
761761
"Kyoto" : {
762762

763+
},
764+
"Loading wallet…" : {
765+
"comment" : "A message displayed while the wallet is loading.",
766+
"isCommentAutoGenerated" : true
763767
},
764768
"Navigation Title" : {
765769
"extractionState" : "stale",

BDKSwiftExampleWallet/View/HomeView.swift

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,19 @@ struct HomeView: View {
1515
ZStack {
1616
Color(uiColor: UIColor.systemBackground)
1717

18-
WalletView(
19-
viewModel: .init(
20-
bdkClient: .live,
21-
priceClient: .live
22-
),
23-
sendNavigationPath: $navigationPath
24-
)
25-
.tint(.primary)
18+
if viewModel.isWalletLoaded {
19+
WalletView(
20+
viewModel: .init(
21+
bdkClient: .live,
22+
priceClient: .live
23+
),
24+
sendNavigationPath: $navigationPath
25+
)
26+
.tint(.primary)
27+
} else {
28+
ProgressView("Loading wallet…")
29+
.tint(.primary)
30+
}
2631
}
2732
.onAppear {
2833
viewModel.loadWallet()

0 commit comments

Comments
 (0)