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:
parent
f652560da9
commit
6537b7a6b5
1 changed files with 2 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue