fix lifecycle issues
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ import 'package:weblibre/features/geckoview/features/find_in_page/domain/reposit
|
||||
|
||||
part 'find_in_page.g.dart';
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
@Riverpod()
|
||||
class FindInPageController extends _$FindInPageController {
|
||||
void show() {
|
||||
state = state.copyWith.visible(true);
|
||||
|
||||
+3
-3
@@ -20,7 +20,7 @@ final class FindInPageControllerProvider
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'findInPageControllerProvider',
|
||||
isAutoDispose: false,
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -59,7 +59,7 @@ final class FindInPageControllerProvider
|
||||
}
|
||||
|
||||
String _$findInPageControllerHash() =>
|
||||
r'da72e38225809af5c78a372e949a80207d7ce7c9';
|
||||
r'85e6b69edcd66a961d51326b01336a969d37fac1';
|
||||
|
||||
final class FindInPageControllerFamily extends $Family
|
||||
with
|
||||
@@ -76,7 +76,7 @@ final class FindInPageControllerFamily extends $Family
|
||||
name: r'findInPageControllerProvider',
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: false,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
FindInPageControllerProvider call(String tabId) =>
|
||||
|
||||
@@ -28,7 +28,7 @@ import 'package:weblibre/features/search/util/tokenized_filter.dart';
|
||||
|
||||
part 'providers.g.dart';
|
||||
|
||||
@Riverpod()
|
||||
@Riverpod(keepAlive: true)
|
||||
Stream<List<ContainerDataWithCount>> containersWithCount(Ref ref) {
|
||||
final db = ref.watch(tabDatabaseProvider);
|
||||
return db.definitionsDrift.containersWithCount().watch();
|
||||
|
||||
@@ -28,7 +28,7 @@ final class ContainersWithCountProvider
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'containersWithCountProvider',
|
||||
isAutoDispose: true,
|
||||
isAutoDispose: false,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -49,7 +49,7 @@ final class ContainersWithCountProvider
|
||||
}
|
||||
|
||||
String _$containersWithCountHash() =>
|
||||
r'd08294ef0def19b3401552fa9d533c9a780fa3dd';
|
||||
r'757bb0102afedc07ef0f80a420b4c87cbdbed3e1';
|
||||
|
||||
@ProviderFor(matchSortedContainersWithCount)
|
||||
const matchSortedContainersWithCountProvider =
|
||||
|
||||
@@ -33,7 +33,7 @@ part 'selected_container.g.dart';
|
||||
|
||||
enum SetContainerResult { failed, success, successHasProxy }
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
@Riverpod()
|
||||
class SelectedContainer extends _$SelectedContainer {
|
||||
Future<ContainerData?> fetchData() async {
|
||||
if (state != null) {
|
||||
|
||||
@@ -20,7 +20,7 @@ final class SelectedContainerProvider
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'selectedContainerProvider',
|
||||
isAutoDispose: false,
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -41,7 +41,7 @@ final class SelectedContainerProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$selectedContainerHash() => r'9e9a9b5e3c91ff1fbf8544e329524f8e064587fe';
|
||||
String _$selectedContainerHash() => r'78a43c90ad5e4906ebb33f6b865b23adeb4cae8f';
|
||||
|
||||
abstract class _$SelectedContainer extends $Notifier<String?> {
|
||||
String? build();
|
||||
|
||||
@@ -176,7 +176,7 @@ class GeckoInferenceRepository extends _$GeckoInferenceRepository {
|
||||
void build() {}
|
||||
}
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
@Riverpod()
|
||||
Future<String?> containerTopic(Ref ref, String containerId) async {
|
||||
final titles = await ref.watch(
|
||||
containerTabsDataProvider(containerId).selectAsync(
|
||||
@@ -189,6 +189,10 @@ Future<String?> containerTopic(Ref ref, String containerId) async {
|
||||
.read(geckoInferenceRepositoryProvider.notifier)
|
||||
.predictDocumentTopic(titles.value);
|
||||
|
||||
if (topic.isNotEmpty) {
|
||||
ref.keepAlive();
|
||||
}
|
||||
|
||||
return topic;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ final class ContainerTopicProvider
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'containerTopicProvider',
|
||||
isAutoDispose: false,
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -112,7 +112,7 @@ final class ContainerTopicProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$containerTopicHash() => r'b680381eab3dded9ca6f174fbcc5da5c59d7e9f0';
|
||||
String _$containerTopicHash() => r'dd2af0571a84f9cc2536af6a1079e7ee58e2a0a5';
|
||||
|
||||
final class ContainerTopicFamily extends $Family
|
||||
with $FunctionalFamilyOverride<FutureOr<String?>, String> {
|
||||
@@ -122,7 +122,7 @@ final class ContainerTopicFamily extends $Family
|
||||
name: r'containerTopicProvider',
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: false,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
ContainerTopicProvider call(String containerId) =>
|
||||
|
||||
Reference in New Issue
Block a user