Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions BDKSwiftExampleWallet/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,10 @@
}
}
},
"Keep Kyoto open while it bootstraps." : {
"comment" : "A notice explaining that the user should keep Kyoto open while it bootstraps.",
"isCommentAutoGenerated" : true
},
"Kyoto" : {

},
Expand Down Expand Up @@ -1268,6 +1272,10 @@
}
}
},
"This one-time sync can take a few minutes." : {
"comment" : "A description of the time it takes to sync with Kyoto.",
"isCommentAutoGenerated" : true
},
"To" : {
"extractionState" : "stale",
"localizations" : {
Expand Down
42 changes: 42 additions & 0 deletions BDKSwiftExampleWallet/View/WalletView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ struct WalletView: View {
showAllTransactions = true
}

if shouldShowKyotoInitialSyncNotice {
KyotoInitialSyncNoticeView(isConnected: viewModel.isKyotoConnected)
.transition(.opacity)
}

TransactionListView(
viewModel: .init(),
transactions: viewModel.recentTransactions,
Expand Down Expand Up @@ -227,3 +232,40 @@ struct WalletView: View {
)
}
#endif

extension WalletView {
fileprivate var shouldShowKyotoInitialSyncNotice: Bool {
viewModel.isKyotoClient
&& viewModel.needsFullScan
&& viewModel.walletSyncState == .syncing
}
}

private struct KyotoInitialSyncNoticeView: View {
let isConnected: Bool

var body: some View {
HStack(alignment: .top, spacing: 12) {
Image(systemName: "clock.arrow.circlepath")
.font(.title3)
.foregroundStyle(.orange)

VStack(alignment: .leading, spacing: 4) {
Text(
"Keep Kyoto open while it bootstraps."
)
.font(.subheadline)
.fontWeight(.semibold)

Text(
"This one-time sync can take a few minutes."
)
.font(.footnote)
.foregroundStyle(.secondary)
}
}
.padding()
.frame(maxWidth: .infinity, alignment: .leading)
.background(.thinMaterial, in: RoundedRectangle(cornerRadius: 16, style: .continuous))
}
}