fix lifecycle issues
This commit is contained in:
@@ -46,6 +46,7 @@ GeckoSelectionActionService selectionActionService(Ref ref) {
|
||||
final settings = ref.read(generalSettingsWithDefaultsProvider);
|
||||
final route = SearchRoute(
|
||||
tabType:
|
||||
// ignore: only_use_keep_alive_inside_keep_alive
|
||||
ref.read(selectedTabTypeProvider) ??
|
||||
settings.defaultCreateTabType,
|
||||
searchText: text,
|
||||
@@ -59,6 +60,7 @@ GeckoSelectionActionService selectionActionService(Ref ref) {
|
||||
);
|
||||
|
||||
if (defaultSearchBang != null) {
|
||||
// ignore: only_use_keep_alive_inside_keep_alive
|
||||
final currentTab = ref.read(selectedTabStateProvider);
|
||||
final isPrivate =
|
||||
currentTab?.isPrivate ??
|
||||
@@ -81,6 +83,7 @@ GeckoSelectionActionService selectionActionService(Ref ref) {
|
||||
FindInPageAction((text) async {
|
||||
final tabId = ref.read(selectedTabProvider);
|
||||
if (tabId != null) {
|
||||
// ignore: only_use_keep_alive_inside_keep_alive
|
||||
await ref
|
||||
.read(findInPageControllerProvider(tabId).notifier)
|
||||
.findAll(text: text);
|
||||
|
||||
@@ -245,7 +245,7 @@ TabType? selectedTabType(Ref ref) {
|
||||
);
|
||||
}
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
@Riverpod()
|
||||
AsyncValue<String?> selectedTabContainerId(Ref ref) {
|
||||
final tabId = ref.watch(selectedTabProvider);
|
||||
if (tabId != null) {
|
||||
|
||||
@@ -238,7 +238,7 @@ final class SelectedTabContainerIdProvider
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'selectedTabContainerIdProvider',
|
||||
isAutoDispose: false,
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -267,7 +267,7 @@ final class SelectedTabContainerIdProvider
|
||||
}
|
||||
|
||||
String _$selectedTabContainerIdHash() =>
|
||||
r'9f0246a02a069b1a66211a3924f32e9d75f0f344';
|
||||
r'07899d29f69654d3b314d0da945ad402b1003b41';
|
||||
|
||||
@ProviderFor(tabScrollY)
|
||||
const tabScrollYProvider = TabScrollYFamily._();
|
||||
|
||||
@@ -69,6 +69,7 @@ class TabRepository extends _$TabRepository {
|
||||
final assingedContainer =
|
||||
container ??
|
||||
Value<ContainerData?>(
|
||||
// ignore: only_use_keep_alive_inside_keep_alive
|
||||
await ref.read(selectedContainerProvider.notifier).fetchData(),
|
||||
);
|
||||
|
||||
@@ -183,6 +184,7 @@ class TabRepository extends _$TabRepository {
|
||||
|
||||
if (containerData != null) {
|
||||
if (containerData.metadata.authSettings.authenticationRequired) {
|
||||
// ignore: only_use_keep_alive_inside_keep_alive
|
||||
if (containerId != ref.read(selectedContainerProvider)) {
|
||||
logger.w(
|
||||
'Tried to open authenticated tab $tabId but container not selected',
|
||||
@@ -295,6 +297,7 @@ class TabRepository extends _$TabRepository {
|
||||
final db = ref.watch(tabDatabaseProvider);
|
||||
|
||||
final tabAddedSub = eventSerivce.tabAddedStream.listen((tabId) async {
|
||||
// ignore: only_use_keep_alive_inside_keep_alive
|
||||
final containerId = ref.read(selectedContainerProvider);
|
||||
await db.tabDao.upsertUnassignedTab(
|
||||
tabId,
|
||||
|
||||
Reference in New Issue
Block a user