mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-14 16:25:16 +00:00
fix: spotify query hooks overriding default query params
This commit is contained in:
parent
23473af773
commit
ec9a02e8b8
@ -15,8 +15,8 @@ InfiniteQuery<DataType, ErrorType, PageType>
|
||||
required WidgetRef ref,
|
||||
required InfiniteQueryNextPage<DataType, PageType> nextPage,
|
||||
required PageType initialPage,
|
||||
RetryConfig retryConfig = DefaultConstants.retryConfig,
|
||||
RefreshConfig refreshConfig = DefaultConstants.refreshConfig,
|
||||
RetryConfig? retryConfig,
|
||||
RefreshConfig? refreshConfig,
|
||||
JsonConfig<DataType>? jsonConfig,
|
||||
ValueChanged<PageEvent<DataType, PageType>>? onData,
|
||||
ValueChanged<PageEvent<ErrorType, PageType>>? onError,
|
||||
|
@ -10,7 +10,7 @@ Mutation<DataType, ErrorType, VariablesType>
|
||||
Future<DataType> Function(VariablesType variables, SpotifyApi spotify)
|
||||
mutationFn, {
|
||||
required WidgetRef ref,
|
||||
RetryConfig retryConfig = DefaultConstants.retryConfig,
|
||||
RetryConfig? retryConfig,
|
||||
MutationOnDataFn<DataType, RecoveryType>? onData,
|
||||
MutationOnErrorFn<ErrorType, RecoveryType>? onError,
|
||||
MutationOnMutationFn<VariablesType, RecoveryType>? onMutate,
|
||||
|
@ -16,8 +16,8 @@ Query<DataType, ErrorType> useSpotifyQuery<DataType, ErrorType>(
|
||||
final SpotifyQueryFn<DataType> 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<DataType>? jsonConfig,
|
||||
final ValueChanged<DataType>? onData,
|
||||
final ValueChanged<ErrorType>? onError,
|
||||
|
@ -172,6 +172,7 @@ void main(List<String> rawArgs) async {
|
||||
)
|
||||
],
|
||||
child: QueryClientProvider(
|
||||
staleDuration: const Duration(minutes: 30),
|
||||
child: const Spotube(),
|
||||
),
|
||||
);
|
||||
|
@ -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<Page<Category>, dynamic, int> list(
|
||||
WidgetRef ref, String recommendationMarket) {
|
||||
final context = useContext();
|
||||
|
||||
return useSpotifyInfiniteQuery<Page<Category>, 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,
|
||||
);
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user