diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md index 7167eb858..125d1cae9 100644 --- a/CONTRIBUTION.md +++ b/CONTRIBUTION.md @@ -29,7 +29,7 @@ All types of contributions are encouraged and valued. See the [Table of Contents ## Code of Conduct This project and everyone participating in it is governed by the -[Spotube Code of Conduct](https://github.com/KRTirtho/spotubeblob/master/CODE_OF_CONDUCT.md). +[Spotube Code of Conduct](https://github.com/KRTirtho/spotube/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to <>. diff --git a/lib/components/root/sidebar.dart b/lib/components/root/sidebar.dart index 5820658df..62cc569ee 100644 --- a/lib/components/root/sidebar.dart +++ b/lib/components/root/sidebar.dart @@ -198,14 +198,6 @@ class SidebarFooter extends HookConsumerWidget { placeholder: ImagePlaceholder.artist, ); - useEffect(() { - if (auth.isLoggedIn && !me.hasData) { - me.setExternalData(ref.read(spotifyProvider)); - me.refetch(); - } - return; - }, [auth.isLoggedIn, me.hasData]); - return Padding( padding: const EdgeInsets.all(16).copyWith(left: 0), child: Row( diff --git a/lib/main.dart b/lib/main.dart index 8b2c3da7e..5710c55f2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,7 +27,7 @@ import 'package:spotube/themes/dark_theme.dart'; import 'package:spotube/themes/light_theme.dart'; import 'package:spotube/utils/platform.dart'; -final bowl = QueryBowl(refetchOnExternalDataChange: true); +final bowl = QueryBowl(); void main() async { await Hive.initFlutter(); Hive.registerAdapter(CacheTrackAdapter()); diff --git a/lib/pages/lyrics/genius_lyrics.dart b/lib/pages/lyrics/genius_lyrics.dart index 04465bcee..e19cfb77c 100644 --- a/lib/pages/lyrics/genius_lyrics.dart +++ b/lib/pages/lyrics/genius_lyrics.dart @@ -33,17 +33,6 @@ class GeniusLyrics extends HookConsumerWidget { final breakpoint = useBreakpoints(); final textTheme = Theme.of(context).textTheme; - useEffect(() { - if (playback.track != null) { - geniusLyricsQuery.setExternalData(Tuple2( - playback.track, - ref.read(userPreferencesProvider).geniusAccessToken, - )); - geniusLyricsQuery.refetch(); - } - return null; - }, [playback.track]); - return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ @@ -75,7 +64,8 @@ class GeniusLyrics extends HookConsumerWidget { padding: const EdgeInsets.all(8.0), child: Builder( builder: (context) { - if (geniusLyricsQuery.isLoading) { + if (geniusLyricsQuery.isLoading || + geniusLyricsQuery.isRefetching) { return const ShimmerLyrics(); } else if (geniusLyricsQuery.hasError) { return Text( diff --git a/lib/services/queries/lyrics.dart b/lib/services/queries/lyrics.dart index eb5f9712a..c5f83216e 100644 --- a/lib/services/queries/lyrics.dart +++ b/lib/services/queries/lyrics.dart @@ -9,6 +9,7 @@ import 'package:tuple/tuple.dart'; class LyricsQueries { final static = QueryJob>( queryKey: "genius-lyrics-query", + refetchOnExternalDataChange: true, task: (_, externalData) async { final currentTrack = externalData.item1; final geniusAccessToken = externalData.item2; diff --git a/lib/services/queries/search.dart b/lib/services/queries/search.dart index 721349ca5..3984bac1a 100644 --- a/lib/services/queries/search.dart +++ b/lib/services/queries/search.dart @@ -6,6 +6,7 @@ class SearchQueries { final get = InfiniteQueryJob.withVariableKey, Tuple2, int>( preQueryKey: "search-query", + refetchOnExternalDataChange: true, initialParam: 0, enabled: false, getNextPageParam: (lastPage, lastParam) => diff --git a/pubspec.lock b/pubspec.lock index 8170dfeb2..e1397a28a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -359,7 +359,7 @@ packages: name: connectivity_plus url: "https://pub.dartlang.org" source: hosted - version: "2.3.7" + version: "2.3.9" connectivity_plus_linux: dependency: transitive description: @@ -387,7 +387,7 @@ packages: name: connectivity_plus_web url: "https://pub.dartlang.org" source: hosted - version: "1.2.4" + version: "1.2.5" connectivity_plus_windows: dependency: transitive description: @@ -489,16 +489,16 @@ packages: fl_query: dependency: "direct main" description: - name: fl_query - url: "https://pub.dartlang.org" - source: hosted + path: "../fl-query/packages/fl_query" + relative: true + source: path version: "0.3.1" fl_query_hooks: dependency: "direct main" description: - name: fl_query_hooks - url: "https://pub.dartlang.org" - source: hosted + path: "../fl-query/packages/fl_query_hooks" + relative: true + source: path version: "0.3.1" fluent_ui: dependency: "direct main" diff --git a/pubspec.yaml b/pubspec.yaml index 02fc99258..a8e5fee2e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -57,8 +57,10 @@ dependencies: url: https://github.com/KRTirtho/metadata_god.git ref: 7d195fdde324b382fc12067c56391285807e6233 visibility_detector: ^0.3.3 - fl_query: ^0.3.1 - fl_query_hooks: ^0.3.1 + fl_query: + path: ../fl-query/packages/fl_query + fl_query_hooks: + path: ../fl-query/packages/fl_query_hooks flutter_inappwebview: ^5.4.3+7 tuple: ^2.0.1 uuid: ^3.0.6