Skip to content

Commit

Permalink
fix: personalized playlists not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jun 1, 2023
1 parent 27e8acb commit caa3408
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/services/queries/views.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ViewsQueries {

final locale = useContext().l10n.localeName;

return useQuery<Map<String, dynamic>?, dynamic>("views/$view", () {
final query = useQuery<Map<String, dynamic>?, dynamic>("views/$view", () {
if (auth == null) return null;
return customSpotify.getView(
view,
Expand All @@ -30,5 +30,18 @@ class ViewsQueries {
locale: locale,
);
});

useEffect(() {
return ref.listenManual(
customSpotifyEndpointProvider,
(previous, next) {
if (previous != next) {
query.refresh();
}
},
).close;
}, [query]);

return query;
}
}

0 comments on commit caa3408

Please sign in to comment.