Fix deletion freeze
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -68,7 +68,7 @@ export function useMutationWithToasts<T extends MutationParameters>(
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
[mutate]
|
[mutate, toast, __]
|
||||||
);
|
);
|
||||||
|
|
||||||
return [mutateWithToast, isLoading] as const;
|
return [mutateWithToast, isLoading] as const;
|
||||||
|
|||||||
@@ -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 (
|
||||||
|
|||||||
Reference in New Issue
Block a user