Fix deletion freeze
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -79,13 +79,14 @@ export function ConfirmDialog() {
|
||||
footer,
|
||||
} = dialog();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const handleConfirm = () => {
|
||||
const handleConfirm = async () => {
|
||||
setLoading(true);
|
||||
onConfirm()
|
||||
.finally(() => {
|
||||
close();
|
||||
setLoading(false);
|
||||
});
|
||||
try {
|
||||
await onConfirm();
|
||||
} finally {
|
||||
close();
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user