0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(console): block subsequent requests on deleting apps (#5365)

This commit is contained in:
Charles Zhao 2024-02-02 11:51:24 +08:00 committed by GitHub
parent f652560da9
commit 6537b7a6b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -84,18 +84,14 @@ function ApplicationDetailsContent({ data, oidcConfig, onApplicationUpdated }: P
);
const onDelete = async () => {
if (isDeleting) {
return;
}
setIsDeleting(true);
try {
await api.delete(`api/applications/${data.id}`);
setIsDeleted(true);
setIsDeleting(false);
setIsDeleteFormOpen(false);
toast.success(t('application_details.application_deleted', { name: data.name }));
navigate(`/applications`);
} catch {
} finally {
setIsDeleting(false);
}
};