mirror of
https://github.com/stashapp/stash.git
synced 2026-05-09 05:05:29 +02:00
fix(ui): refresh image duplicate checker after deletes
This commit is contained in:
parent
374d94932b
commit
ac389e0b97
2 changed files with 11 additions and 5 deletions
|
|
@ -34,6 +34,8 @@ import { Pagination } from "src/components/List/Pagination";
|
|||
import { DeleteImagesDialog } from "../Images/DeleteImagesDialog";
|
||||
import { EditImagesDialog } from "../Images/EditImagesDialog";
|
||||
import { Icon } from "../Shared/Icon";
|
||||
import { LoadingIndicator } from "../Shared/LoadingIndicator";
|
||||
import { ErrorMessage } from "../Shared/ErrorMessage";
|
||||
|
||||
const CLASSNAME = "duplicate-checker";
|
||||
|
||||
|
|
@ -136,20 +138,20 @@ const ImageDuplicateChecker: React.FC = () => {
|
|||
setCheckedImages({});
|
||||
};
|
||||
|
||||
const onDeleteDialogClosed = (confirmed: boolean) => {
|
||||
const onDeleteDialogClosed = async (confirmed: boolean) => {
|
||||
setDeletingImages(false);
|
||||
setSelectedImages(undefined);
|
||||
if (confirmed) {
|
||||
setCheckedImages({});
|
||||
refetch();
|
||||
await refetch();
|
||||
}
|
||||
};
|
||||
|
||||
const onEditDialogClosed = (applied: boolean) => {
|
||||
const onEditDialogClosed = async (applied: boolean) => {
|
||||
setEditingImages(false);
|
||||
setSelectedImages(undefined);
|
||||
if (applied) {
|
||||
refetch();
|
||||
await refetch();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -173,6 +175,9 @@ const ImageDuplicateChecker: React.FC = () => {
|
|||
});
|
||||
}, [allGroups.length]);
|
||||
|
||||
if (loading) return <LoadingIndicator />;
|
||||
if (!data) return <ErrorMessage error="Error searching for duplicates." />;
|
||||
|
||||
const setQuery = (q: Record<string, string | number | undefined>) => {
|
||||
const newQuery = new URLSearchParams(query);
|
||||
for (const key of Object.keys(q)) {
|
||||
|
|
|
|||
|
|
@ -61,11 +61,12 @@ export const DeleteImagesDialog: React.FC<IDeleteImageDialogProps> = (
|
|||
try {
|
||||
await deleteImage();
|
||||
Toast.success(toastMessage);
|
||||
props.onClose(true);
|
||||
} catch (e) {
|
||||
Toast.error(e);
|
||||
props.onClose(false);
|
||||
}
|
||||
setIsDeleting(false);
|
||||
props.onClose(true);
|
||||
}
|
||||
|
||||
function maybeRenderDeleteFileAlert() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue