fix(watchlist): refresh see-all grid after toggling watchlist

The see-all screen keeps its own infinite query keyed
["favorites", "see-all", type, filter]. The watchlist mutation only
invalidated ["item", id] and ["home", "watchlist"], so removing an item
from within the see-all grid left it visible until a manual refresh.
Invalidate the ["favorites", "see-all"] prefix in onSettled as well.
This commit is contained in:
Gauvain
2026-07-01 22:11:53 +02:00
parent 8f1b8fea31
commit 17a591cd3c

View File

@@ -134,6 +134,10 @@ export const useWatchlist = (item: BaseItemDto) => {
onSettled: () => { onSettled: () => {
queryClient.invalidateQueries({ queryKey: itemQueryKeyPrefix }); queryClient.invalidateQueries({ queryKey: itemQueryKeyPrefix });
queryClient.invalidateQueries({ queryKey: ["home", "watchlist"] }); queryClient.invalidateQueries({ queryKey: ["home", "watchlist"] });
// The favorites/watchlist "see all" grid keeps its own infinite query
// (["favorites", "see-all", ...]); invalidate it so removing an item
// from within the see-all screen updates the list in place.
queryClient.invalidateQueries({ queryKey: ["favorites", "see-all"] });
}, },
}); });