Skip to content

Commit

Permalink
update list count button title when adding to watchlist
Browse files Browse the repository at this point in the history
  • Loading branch information
bonukai committed May 3, 2022
1 parent d5397a1 commit 56af94c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/src/api/details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ export const removeFromWatchlist = async (args: {
});
await updateMediaItem(mediaItem);
queryClient.invalidateQueries(['items']);
queryClient.invalidateQueries({
predicate: (query) =>
query.queryKey[0] === 'lists' && query.queryKey[2] === mediaItem.id,
});
};

export const addToWatchlist = async (args: {
Expand All @@ -173,6 +177,10 @@ export const addToWatchlist = async (args: {
});
await updateMediaItem(mediaItem);
queryClient.invalidateQueries(['items']);
queryClient.invalidateQueries({
predicate: (query) =>
query.queryKey[0] === 'lists' && query.queryKey[2] === mediaItem.id,
});
};

export const addToProgress = async (args: {
Expand Down

0 comments on commit 56af94c

Please sign in to comment.