mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
fix: lyrics not refetching when tracked changed while being in another page and sidebar user avatar not showing on startup
This commit is contained in:
parent
d674b61275
commit
bd126751e9
@ -29,7 +29,7 @@ All types of contributions are encouraged and valued. See the [Table of Contents
|
|||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
This project and everyone participating in it is governed by the
|
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
|
By participating, you are expected to uphold this code. Please report unacceptable behavior
|
||||||
to <>.
|
to <>.
|
||||||
|
|
||||||
|
@ -198,14 +198,6 @@ class SidebarFooter extends HookConsumerWidget {
|
|||||||
placeholder: ImagePlaceholder.artist,
|
placeholder: ImagePlaceholder.artist,
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() {
|
|
||||||
if (auth.isLoggedIn && !me.hasData) {
|
|
||||||
me.setExternalData(ref.read(spotifyProvider));
|
|
||||||
me.refetch();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}, [auth.isLoggedIn, me.hasData]);
|
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(16).copyWith(left: 0),
|
padding: const EdgeInsets.all(16).copyWith(left: 0),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
@ -27,7 +27,7 @@ import 'package:spotube/themes/dark_theme.dart';
|
|||||||
import 'package:spotube/themes/light_theme.dart';
|
import 'package:spotube/themes/light_theme.dart';
|
||||||
import 'package:spotube/utils/platform.dart';
|
import 'package:spotube/utils/platform.dart';
|
||||||
|
|
||||||
final bowl = QueryBowl(refetchOnExternalDataChange: true);
|
final bowl = QueryBowl();
|
||||||
void main() async {
|
void main() async {
|
||||||
await Hive.initFlutter();
|
await Hive.initFlutter();
|
||||||
Hive.registerAdapter(CacheTrackAdapter());
|
Hive.registerAdapter(CacheTrackAdapter());
|
||||||
|
@ -33,17 +33,6 @@ class GeniusLyrics extends HookConsumerWidget {
|
|||||||
final breakpoint = useBreakpoints();
|
final breakpoint = useBreakpoints();
|
||||||
final textTheme = Theme.of(context).textTheme;
|
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(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
@ -75,7 +64,8 @@ class GeniusLyrics extends HookConsumerWidget {
|
|||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if (geniusLyricsQuery.isLoading) {
|
if (geniusLyricsQuery.isLoading ||
|
||||||
|
geniusLyricsQuery.isRefetching) {
|
||||||
return const ShimmerLyrics();
|
return const ShimmerLyrics();
|
||||||
} else if (geniusLyricsQuery.hasError) {
|
} else if (geniusLyricsQuery.hasError) {
|
||||||
return Text(
|
return Text(
|
||||||
|
@ -9,6 +9,7 @@ import 'package:tuple/tuple.dart';
|
|||||||
class LyricsQueries {
|
class LyricsQueries {
|
||||||
final static = QueryJob<String, Tuple2<Track?, String>>(
|
final static = QueryJob<String, Tuple2<Track?, String>>(
|
||||||
queryKey: "genius-lyrics-query",
|
queryKey: "genius-lyrics-query",
|
||||||
|
refetchOnExternalDataChange: true,
|
||||||
task: (_, externalData) async {
|
task: (_, externalData) async {
|
||||||
final currentTrack = externalData.item1;
|
final currentTrack = externalData.item1;
|
||||||
final geniusAccessToken = externalData.item2;
|
final geniusAccessToken = externalData.item2;
|
||||||
|
@ -6,6 +6,7 @@ class SearchQueries {
|
|||||||
final get = InfiniteQueryJob.withVariableKey<List<Page>,
|
final get = InfiniteQueryJob.withVariableKey<List<Page>,
|
||||||
Tuple2<String, SpotifyApi>, int>(
|
Tuple2<String, SpotifyApi>, int>(
|
||||||
preQueryKey: "search-query",
|
preQueryKey: "search-query",
|
||||||
|
refetchOnExternalDataChange: true,
|
||||||
initialParam: 0,
|
initialParam: 0,
|
||||||
enabled: false,
|
enabled: false,
|
||||||
getNextPageParam: (lastPage, lastParam) =>
|
getNextPageParam: (lastPage, lastParam) =>
|
||||||
|
16
pubspec.lock
16
pubspec.lock
@ -359,7 +359,7 @@ packages:
|
|||||||
name: connectivity_plus
|
name: connectivity_plus
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.7"
|
version: "2.3.9"
|
||||||
connectivity_plus_linux:
|
connectivity_plus_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -387,7 +387,7 @@ packages:
|
|||||||
name: connectivity_plus_web
|
name: connectivity_plus_web
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.4"
|
version: "1.2.5"
|
||||||
connectivity_plus_windows:
|
connectivity_plus_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -489,16 +489,16 @@ packages:
|
|||||||
fl_query:
|
fl_query:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: fl_query
|
path: "../fl-query/packages/fl_query"
|
||||||
url: "https://pub.dartlang.org"
|
relative: true
|
||||||
source: hosted
|
source: path
|
||||||
version: "0.3.1"
|
version: "0.3.1"
|
||||||
fl_query_hooks:
|
fl_query_hooks:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: fl_query_hooks
|
path: "../fl-query/packages/fl_query_hooks"
|
||||||
url: "https://pub.dartlang.org"
|
relative: true
|
||||||
source: hosted
|
source: path
|
||||||
version: "0.3.1"
|
version: "0.3.1"
|
||||||
fluent_ui:
|
fluent_ui:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
|
@ -57,8 +57,10 @@ dependencies:
|
|||||||
url: https://github.com/KRTirtho/metadata_god.git
|
url: https://github.com/KRTirtho/metadata_god.git
|
||||||
ref: 7d195fdde324b382fc12067c56391285807e6233
|
ref: 7d195fdde324b382fc12067c56391285807e6233
|
||||||
visibility_detector: ^0.3.3
|
visibility_detector: ^0.3.3
|
||||||
fl_query: ^0.3.1
|
fl_query:
|
||||||
fl_query_hooks: ^0.3.1
|
path: ../fl-query/packages/fl_query
|
||||||
|
fl_query_hooks:
|
||||||
|
path: ../fl-query/packages/fl_query_hooks
|
||||||
flutter_inappwebview: ^5.4.3+7
|
flutter_inappwebview: ^5.4.3+7
|
||||||
tuple: ^2.0.1
|
tuple: ^2.0.1
|
||||||
uuid: ^3.0.6
|
uuid: ^3.0.6
|
||||||
|
Loading…
Reference in New Issue
Block a user