mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-27 22:20:00 -05:00
fix playlist query invalidation
This commit is contained in:
@@ -67,10 +67,6 @@ export default function TrackOptions({
|
||||
|
||||
trigger("notificationSuccess");
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [QueryKeys.UserPlaylists]
|
||||
});
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [QueryKeys.ItemTracks, playlist.Id!],
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ export default function AddPlaylist({
|
||||
|
||||
// Refresh user playlists component in library
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [QueryKeys.FavoritePlaylists]
|
||||
queryKey: [QueryKeys.UserPlaylists]
|
||||
});
|
||||
},
|
||||
onError: () => {
|
||||
|
||||
@@ -32,12 +32,15 @@ export default function DeletePlaylist(
|
||||
preset: 'done'
|
||||
});
|
||||
|
||||
// Refresh user playlists component in library
|
||||
// Refresh favorite playlists component in library
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [QueryKeys.FavoritePlaylists]
|
||||
});
|
||||
|
||||
|
||||
// Refresh home screen user playlists
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [QueryKeys.UserPlaylists]
|
||||
});
|
||||
},
|
||||
onError: () => {
|
||||
trigger("notificationError");
|
||||
|
||||
@@ -108,6 +108,7 @@ export default function Playlist({
|
||||
onSuccess: () => {
|
||||
trigger('notificationSuccess');
|
||||
|
||||
// Refresh playlist component data
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [QueryKeys.ItemTracks, playlist.Id]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user