Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

fix: clean up whitespace and improve dialog handling in DeleteCredentialsModal

Muhammad Hamza Khan1a29792100dd
diff --git a/packages/app/src/react/features/credentials/components/delete-credentials.modal.tsx b/packages/app/src/react/features/credentials/components/delete-credentials.modal.tsx
index ecdb4b55..53134e21 100644
--- a/packages/app/src/react/features/credentials/components/delete-credentials.modal.tsx
+++ b/packages/app/src/react/features/credentials/components/delete-credentials.modal.tsx
@@ -68,11 +68,11 @@ export const DeleteCredentialsModal: FC<DeleteCredentialsModalProps> = ({
setIsDeleting(true);
setError(null);
-
+
try {
// Try to delete without consent first
const result = await credentialsClient.deleteCredential(credentialId, group, false);
-
+
// If warnings are returned, show them
if (!result.success && result.warnings && result.warnings.length > 0) {
setWarnings(result.warnings);
@@ -95,11 +95,11 @@ export const DeleteCredentialsModal: FC<DeleteCredentialsModalProps> = ({
const handleConfirmWithWarnings = async () => {
setIsDeleting(true);
setError(null);
-
+
try {
// Delete with consent
const result = await credentialsClient.deleteCredential(credentialId, group, true);
-
+
if (result.success) {
successToast('Credential deleted successfully.');
onClose();
@@ -122,7 +122,7 @@ export const DeleteCredentialsModal: FC<DeleteCredentialsModalProps> = ({
const isValid = confirmText === credentialName;
return (
- <Dialog open={isOpen} onOpenChange={onClose}>
+ <Dialog open={isOpen} onOpenChange={showWarnings ? handleBackFromWarnings : onClose}>
<DialogContent className="sm:max-w-[500px]">
<DialogHeader>
<DialogTitle>
@@ -206,12 +206,6 @@ export const DeleteCredentialsModal: FC<DeleteCredentialsModalProps> = ({
<DialogFooter>
{!showWarnings ? (
<>
- <CustomButton
- variant="secondary"
- label="Cancel"
- handleClick={onClose}
- disabled={isDeleting}
- />
<CustomButton
variant="primary"
label={isDeleting ? 'Checking...' : 'Delete Credential'}
@@ -223,12 +217,6 @@ export const DeleteCredentialsModal: FC<DeleteCredentialsModalProps> = ({
</>
) : (
<>
- <CustomButton
- variant="secondary"
- label="Cancel"
- handleClick={handleBackFromWarnings}
- disabled={isDeleting}
- />
<CustomButton
variant="primary"
label={isDeleting ? 'Deleting...' : 'Delete Anyway'}