fix: try to fix invalidate cache in prod

This commit is contained in:
Fredrik Burmester
2024-11-26 21:54:35 +01:00
parent e8f4ee2264
commit 1fdf45daa7
2 changed files with 9 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ import { useQueryClient } from "@tanstack/react-query";
export function useRevalidatePlaybackProgressCache() {
const queryClient = useQueryClient();
const revalidate = () => {
const revalidate = async () => {
// List of all the queries to invalidate
const queriesToInvalidate = [
["item"],
@@ -20,9 +20,9 @@ export function useRevalidatePlaybackProgressCache() {
];
// Invalidate each query
queriesToInvalidate.forEach((queryKey) => {
queryClient.invalidateQueries({ queryKey });
});
for (const queryKey of queriesToInvalidate) {
await queryClient.invalidateQueries({ queryKey });
}
};
return revalidate;