Skip to content

Commit

Permalink
Release management: reset queries instead of invalidating, to not mak…
Browse files Browse the repository at this point in the history
…e it seem broken (#1086)
  • Loading branch information
harshithmohan authored Sep 30, 2024
1 parent f630de2 commit a18fab3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Checkbox from '@/components/Input/Checkbox';
import ModalPanel from '@/components/Panels/ModalPanel';
import toast from '@/components/Toast';
import { useDeleteFilesMutation } from '@/core/react-query/file/mutations';
import { resetQueries } from '@/core/react-query/queryClient';
import { useSeriesFileSummaryQuery } from '@/core/react-query/webui/queries';
import useEventCallback from '@/hooks/useEventCallback';

Expand Down Expand Up @@ -58,6 +59,7 @@ const QuickSelectModal = ({ onClose, seriesId, show }: Props) => {
{ fileIds, removeFolder: true },
{
onSuccess: () => {
resetQueries(['release-management']);
toast.success(`${fileIds.length} ${fileIds.length === 1 ? 'file' : 'files'} deleted!`);
onClose();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import QuickSelectModal from '@/components/Utilities/ReleaseManagement/QuickSele
import Title from '@/components/Utilities/ReleaseManagement/Title';
import MenuButton from '@/components/Utilities/Unrecognized/MenuButton';
import { useDeleteFileMutation, useMarkVariationMutation } from '@/core/react-query/file/mutations';
import { invalidateQueries } from '@/core/react-query/queryClient';
import { invalidateQueries, resetQueries } from '@/core/react-query/queryClient';
import useEventCallback from '@/hooks/useEventCallback';

import type { MultipleFileOptionsType } from '@/components/Utilities/constants';
Expand Down Expand Up @@ -60,7 +60,7 @@ const MultiplesUtil = () => {
.catch(() => toast.error('One or more operations failed!'))
.finally(() => {
setOperationsPending(false);
invalidateQueries(['release-management', 'series']);
resetQueries(['release-management']);
setSelectedEpisode(undefined);
});
});
Expand Down

0 comments on commit a18fab3

Please sign in to comment.