fix(plugin): stop loading when uninstall fails

This commit is contained in:
yessenia 2025-10-23 11:40:12 +08:00
parent 42a9a88ae2
commit 5a5c7f38d1
1 changed files with 12 additions and 5 deletions

View File

@ -92,11 +92,18 @@ const Action: FC<Props> = ({
const handleDelete = useCallback(async () => {
showDeleting()
const res = await uninstallPlugin(installationId)
hideDeleting()
if (res.success) {
hideDeleteConfirm()
onDelete()
try{
const res = await uninstallPlugin(installationId)
if (res.success) {
hideDeleteConfirm()
onDelete()
}
}
catch (error) {
console.error('uninstallPlugin error', error)
}
finally {
hideDeleting()
}
}, [installationId, onDelete])
return (