Fix deletion freeze

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-11-07 17:31:15 +01:00
parent 55cf769f8a
commit b25d30d3c7
2 changed files with 8 additions and 7 deletions

View File

@@ -68,7 +68,7 @@ export function useMutationWithToasts<T extends MutationParameters>(
}) })
); );
}, },
[mutate] [mutate, toast, __]
); );
return [mutateWithToast, isLoading] as const; return [mutateWithToast, isLoading] as const;

View File

@@ -79,13 +79,14 @@ export function ConfirmDialog() {
footer, footer,
} = dialog(); } = dialog();
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const handleConfirm = () => { const handleConfirm = async () => {
setLoading(true); setLoading(true);
onConfirm() try {
.finally(() => { await onConfirm();
} finally {
close(); close();
setLoading(false); setLoading(false);
}); }
}; };
return ( return (