Skip to content

Commit e3c9ebb

Browse files
committed
feat: refresh walletview from getaddress
1 parent aa70242 commit e3c9ebb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

BDKSwiftExampleWallet/View/Receive/ReceiveView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ struct ReceiveView: View {
8282
.padding()
8383
.onAppear {
8484
viewModel.getAddress()
85+
NotificationCenter.default.post(
86+
name: Notification.Name("AddressGenerated"),
87+
object: nil
88+
)
8589
}
8690

8791
}

BDKSwiftExampleWallet/View/WalletView.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,14 @@ struct WalletView: View {
203203
newTransactionSent = true
204204
}
205205
)
206+
.onReceive(
207+
NotificationCenter.default.publisher(
208+
for: Notification.Name("AddressGenerated")
209+
),
210+
perform: { _ in
211+
newTransactionSent = true
212+
}
213+
)
206214
.task {
207215
if isFirstAppear || newTransactionSent {
208216
await viewModel.syncOrFullScan()

0 commit comments

Comments
 (0)