Skip to content

Commit 6717e20

Browse files
a-mpchphlip9
authored andcommitted
app: fix: fetch payment address when provisioned
1 parent 635854a commit 6717e20

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

app/lib/route/wallet.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ class WalletPageState extends State<WalletPage> {
169169
settings: this.widget.settings,
170170
);
171171

172-
// Read [PaymentAddress] cached value and tries to fetch and update the cached
173-
// from the node.
174-
this.paymentAddressService.init();
175-
176172
// Provision node on refresh.
177173
this.provisionOnRefresh = this.refreshService.refresh.listen(
178174
() => this.provisionService.provision(),
@@ -222,6 +218,8 @@ class WalletPageState extends State<WalletPage> {
222218
this.provisionService.isProvisioned.addListener(() {
223219
if (this.provisionService.isProvisioned.value) {
224220
this.refreshService.triggerRefreshUnthrottled();
221+
// Tries to fetch and update the cached [PaymentAddress] from the node.
222+
this.paymentAddressService.fetch();
225223
}
226224
});
227225

app/lib/service/payment_address.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ class PaymentAddressService {
4141
DateTime.now().difference(this._lastFetchedAt!) >
4242
const Duration(seconds: 10);
4343

44-
void init() {
45-
this._isFetching.value = false;
46-
this.fetch();
47-
}
48-
4944
Future<void> fetch() async {
5045
assert(!this.isDisposed);
5146

0 commit comments

Comments
 (0)