Skip to content

Commit

Permalink
fix(screens): Fix checking mounted in PostList
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Dec 2, 2023
1 parent e61db7b commit 99d150c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/screens/thread/post_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class _NetworkWidgetState<T> extends ConsumerState<PostList<T>> {
Future<void> _loadData() async {
late final uh.Document document;
while (true) {
if (!context.mounted) {
if (!mounted) {
return;
}
final d1 = await ref.read(netClientProvider()).get<dynamic>(
Expand All @@ -173,14 +173,14 @@ class _NetworkWidgetState<T> extends ConsumerState<PostList<T>> {
document = parseHtmlDocument(d1.data as String);
break;
}
if (!context.mounted) {
if (!mounted) {
return;
}
await showRetryToast(context);
}
final data = await widget.listBuilder(document);

if (!context.mounted) {
if (mounted) {
return;
}

Expand Down

0 comments on commit 99d150c

Please sign in to comment.