diff --git a/lib/hooks/use_spotify_infinite_query.dart b/lib/hooks/use_spotify_infinite_query.dart index d56d3ca7a..2063b0833 100644 --- a/lib/hooks/use_spotify_infinite_query.dart +++ b/lib/hooks/use_spotify_infinite_query.dart @@ -15,8 +15,8 @@ InfiniteQuery required WidgetRef ref, required InfiniteQueryNextPage nextPage, required PageType initialPage, - RetryConfig retryConfig = DefaultConstants.retryConfig, - RefreshConfig refreshConfig = DefaultConstants.refreshConfig, + RetryConfig? retryConfig, + RefreshConfig? refreshConfig, JsonConfig? jsonConfig, ValueChanged>? onData, ValueChanged>? onError, diff --git a/lib/hooks/use_spotify_mutation.dart b/lib/hooks/use_spotify_mutation.dart index 7dd9d84e3..637f778f7 100644 --- a/lib/hooks/use_spotify_mutation.dart +++ b/lib/hooks/use_spotify_mutation.dart @@ -10,7 +10,7 @@ Mutation Future Function(VariablesType variables, SpotifyApi spotify) mutationFn, { required WidgetRef ref, - RetryConfig retryConfig = DefaultConstants.retryConfig, + RetryConfig? retryConfig, MutationOnDataFn? onData, MutationOnErrorFn? onError, MutationOnMutationFn? onMutate, diff --git a/lib/hooks/use_spotify_query.dart b/lib/hooks/use_spotify_query.dart index 209f3391a..0c79de917 100644 --- a/lib/hooks/use_spotify_query.dart +++ b/lib/hooks/use_spotify_query.dart @@ -16,8 +16,8 @@ Query useSpotifyQuery( final SpotifyQueryFn queryFn, { required WidgetRef ref, final DataType? initial, - final RetryConfig retryConfig = DefaultConstants.retryConfig, - final RefreshConfig refreshConfig = DefaultConstants.refreshConfig, + final RetryConfig? retryConfig, + final RefreshConfig? refreshConfig, final JsonConfig? jsonConfig, final ValueChanged? onData, final ValueChanged? onError, diff --git a/lib/main.dart b/lib/main.dart index eb566af22..95761e333 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -172,6 +172,7 @@ void main(List rawArgs) async { ) ], child: QueryClientProvider( + staleDuration: const Duration(minutes: 30), child: const Spotube(), ), ); diff --git a/lib/services/queries/category.dart b/lib/services/queries/category.dart index 319a326ad..4f646b13d 100644 --- a/lib/services/queries/category.dart +++ b/lib/services/queries/category.dart @@ -1,5 +1,4 @@ import 'package:fl_query/fl_query.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:spotify/spotify.dart'; import 'package:spotube/hooks/use_spotify_infinite_query.dart'; @@ -9,8 +8,6 @@ class CategoryQueries { InfiniteQuery, dynamic, int> list( WidgetRef ref, String recommendationMarket) { - final context = useContext(); - return useSpotifyInfiniteQuery, dynamic, int>( "category-playlists", (pageParam, spotify) async { @@ -27,10 +24,6 @@ class CategoryQueries { } return lastPageData.nextOffset; }, - refreshConfig: RefreshConfig.withDefaults( - context, - staleDuration: const Duration(minutes: 30), - ), ref: ref, ); } diff --git a/pubspec.lock b/pubspec.lock index 843eb3f86..360e3d362 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -534,18 +534,18 @@ packages: dependency: "direct main" description: name: fl_query - sha256: d9ebed8f024ef8e1eb9770d632ed738539dc576374a3498d5344d6ab27708563 + sha256: b119e0d7e4cb615780f6cab00e7b40f88f8f549d9f8d20f6e1076e08cbf97c42 url: "https://pub.dev" source: hosted - version: "1.0.0-alpha.1" + version: "1.0.0-alpha.2" fl_query_hooks: dependency: "direct main" description: name: fl_query_hooks - sha256: "868974a332ff28ffd837edf995b8c579dac0e590215d8f4d13ce84c7b6f2e53c" + sha256: "9a4263cc5e1ef6e246089602256011172a9d3be212c41c08d67bc365ce6fec22" url: "https://pub.dev" source: hosted - version: "1.0.0-alpha.1" + version: "1.0.0-alpha.2" fluent_ui: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 043badd47..45aa69c0d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,8 +27,8 @@ dependencies: cupertino_icons: ^1.0.5 dbus: ^0.7.8 file_picker: ^5.2.2 - fl_query: ^1.0.0-alpha.0 - fl_query_hooks: ^1.0.0-alpha.0 + fl_query: ^1.0.0-alpha.2 + fl_query_hooks: ^1.0.0-alpha.2 fluent_ui: ^4.3.0 fluentui_system_icons: ^1.1.189 flutter: