Skip to content

Commit

Permalink
style(*): Fix unrelated context mount check
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Feb 16, 2024
1 parent 93e9ec1 commit 3eb2278
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/features/search/view/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class _SearchPageState extends State<SearchPage> {
if (page == null || page == state.searchResult!.currentPage) {
return;
}
if (!mounted) {
if (!context.mounted) {
return;
}
await _search(context, page);
Expand Down
10 changes: 5 additions & 5 deletions lib/features/settings/view/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ class _SettingsPageState extends State<SettingsPage> {
if (localeGroup.$2) {
// Use system language.
LocaleSettings.useDeviceLocale();
if (!mounted) {
if (!context.mounted) {
return;
}
context
.read<SettingsBloc>()
.add(const SettingsChangeLocaleRequested(''));
return;
}
if (!mounted) {
if (!context.mounted) {
return;
}
LocaleSettings.setLocale(localeGroup.$1!);
Expand Down Expand Up @@ -192,7 +192,7 @@ class _SettingsPageState extends State<SettingsPage> {
if (color == null) {
return;
}
if (!mounted) {
if (!context.mounted) {
return;
}
if (color.$2) {
Expand Down Expand Up @@ -268,7 +268,7 @@ class _SettingsPageState extends State<SettingsPage> {
if (result == null) {
return;
}
if (!mounted) {
if (!context.mounted) {
return;
}
context.read<SettingsBloc>().add(
Expand All @@ -289,7 +289,7 @@ class _SettingsPageState extends State<SettingsPage> {
if (result == null) {
return;
}
if (!mounted) {
if (!context.mounted) {
return;
}
context
Expand Down
6 changes: 3 additions & 3 deletions lib/widgets/card/lock_card/locked_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class _LockedCardState extends State<LockedCard> {
coinsLast: info.coinsLast ?? '',
),
);
if (!mounted) {
if (!context.mounted) {
return;
}

Expand All @@ -77,7 +77,7 @@ class _LockedCardState extends State<LockedCard> {
title: context.t.lockedCard.purchase.successPurchase,
message: context.t.lockedCard.purchase.successPurchaseInfo,
);
if (!mounted) {
if (!context.mounted) {
return;
}
context.read<ThreadBloc>().add(ThreadRefreshRequested());
Expand All @@ -87,7 +87,7 @@ class _LockedCardState extends State<LockedCard> {
title: context.t.lockedCard.purchase.failedPurchase,
message: context.t.lockedCard.purchase.failedPurchase,
);
if (!mounted) {
if (!context.mounted) {
return;
}
// Reset purchase state.
Expand Down

0 comments on commit 3eb2278

Please sign in to comment.