From ef11c6c605b7885e846993eacb2082f7cf09b909 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Mon, 15 Jun 2026 15:20:28 +0200 Subject: [PATCH] fix(playlists): refresh playlist detail after add/remove from the feed popover Adding a video to a playlist via the AddToPlaylist popover invalidated the membership and the playlist list, but not the playlist *detail* query, so the Playlists page served stale cached items (the new video only appeared after F5). Invalidate the ["playlist"] detail queries too. --- frontend/src/components/AddToPlaylist.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/components/AddToPlaylist.tsx b/frontend/src/components/AddToPlaylist.tsx index 84dd169..637bb34 100644 --- a/frontend/src/components/AddToPlaylist.tsx +++ b/frontend/src/components/AddToPlaylist.tsx @@ -86,6 +86,9 @@ export default function AddToPlaylist({ function refresh() { qc.invalidateQueries({ queryKey: ["playlist-membership", videoId] }); qc.invalidateQueries({ queryKey: ["playlists"] }); + // Also invalidate every open/cached playlist detail (["playlist", id]) so the + // Playlists page reflects the add/remove when navigated to, not only after F5. + qc.invalidateQueries({ queryKey: ["playlist"] }); } async function toggle(pl: Playlist) {