Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

fix: add context mounted checks for async gaps #309

Merged
merged 1 commit into from
Oct 9, 2024
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
10 changes: 6 additions & 4 deletions lib/features/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ class HomePage extends HookConsumerWidget {

useEffect(
() {
Future.delayed(
Duration.zero,
() async => _getExchanges(context, ref, exchanges),
);
Future.delayed(Duration.zero, () async {
if (context.mounted) {
await _getExchanges(context, ref, exchanges);
}
});

return null;
},
[],
Expand Down
9 changes: 5 additions & 4 deletions lib/features/kcc/kcc_retrieval_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ class KccRetrievalPage extends HookConsumerWidget {

useEffect(
() {
Future.delayed(
Duration.zero,
() async => _pollForCredential(context, ref, credential),
);
Future.delayed(Duration.zero, () async {
if (context.mounted) {
await _pollForCredential(context, ref, credential);
}
});

return null;
},
Expand Down
10 changes: 6 additions & 4 deletions lib/features/kcc/kcc_webview_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ class KccWebviewPage extends HookConsumerWidget {

useEffect(
() {
Future.delayed(
Duration.zero,
() async => _loadWebView(context, ref, idvRequest, webViewController),
);
Future.delayed(Duration.zero, () async {
if (context.mounted) {
await _loadWebView(context, ref, idvRequest, webViewController);
}
});

return null;
},
[],
Expand Down
10 changes: 6 additions & 4 deletions lib/features/payment/payment_amount_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ class PaymentAmountPage extends HookConsumerWidget {

useEffect(
() {
Future.delayed(
Duration.zero,
() => _getOfferings(context, ref, dapState?.currencies, offerings),
);
Future.delayed(Duration.zero, () async {
if (context.mounted) {
await _getOfferings(context, ref, dapState?.currencies, offerings);
}
});

return null;
},
[],
Expand Down
Loading