diff --git a/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.dart b/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.dart index b6d6591b..2d14dcfc 100644 --- a/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.dart +++ b/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.dart @@ -50,15 +50,18 @@ class FindInPageController extends _$FindInPageController { fireImmediately: true, selectedTabStateProvider, (previous, next) async { - if (state.visible && state.lastSearchText.isNotEmpty) { - if (previous != null && next != null) { - final loadingOrReloading = - previous.isLoading == true && next.isLoading == false; - final tabSwitchWithoutResults = - previous.id != next.id && !next.findResultState.hasMatches; + //Ensure state is already initialized + if (stateOrNull != null) { + if (state.visible && state.lastSearchText.isNotEmpty) { + if (previous != null && next != null) { + final loadingOrReloading = + previous.isLoading == true && next.isLoading == false; + final tabSwitchWithoutResults = + previous.id != next.id && !next.findResultState.hasMatches; - if (loadingOrReloading || tabSwitchWithoutResults) { - await findAll(text: state.lastSearchText!); + if (loadingOrReloading || tabSwitchWithoutResults) { + await findAll(text: state.lastSearchText!); + } } } } diff --git a/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.g.dart b/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.g.dart index 808fba2e..a6fd6f71 100644 --- a/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.g.dart +++ b/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.g.dart @@ -7,7 +7,7 @@ part of 'find_in_page.dart'; // ************************************************************************** String _$findInPageControllerHash() => - r'63a2fbf4f75be59d341501c58512792de82fdb3d'; + r'ab421be931406325bf6b22dd9f545117ea426665'; /// See also [FindInPageController]. @ProviderFor(FindInPageController) diff --git a/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.dart b/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.dart index 2e377c14..d241d570 100644 --- a/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.dart +++ b/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.dart @@ -80,7 +80,7 @@ class SelectedContainer extends _$SelectedContainer { fireImmediately: true, containersWithCountProvider, (previous, next) { - if (state != null && next.valueOrNull != null) { + if (stateOrNull != null && next.valueOrNull != null) { if (!next.value!.any((container) => container.id == state)) { clearContainer(); } diff --git a/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.g.dart b/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.g.dart index 20d4e640..49aec496 100644 --- a/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.g.dart +++ b/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.g.dart @@ -25,7 +25,7 @@ final selectedContainerDataProvider = @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element typedef SelectedContainerDataRef = AutoDisposeStreamProviderRef; -String _$selectedContainerHash() => r'075190a8a58cc6de8ce554b0a6ed54809832fdb0'; +String _$selectedContainerHash() => r'736a60b8f19273d3bdc25d1717e3a613384e59a6'; /// See also [SelectedContainer]. @ProviderFor(SelectedContainer)