From 598f9a6fa0f99b41bbac6c4969760270cbcb7994 Mon Sep 17 00:00:00 2001 From: Henry Heng Date: Fri, 1 Nov 2024 01:12:51 +0000 Subject: [PATCH] Bugfix/Save default credential data when add new (#3435) save default credential data when add new --- packages/ui/src/views/credentials/AddEditCredentialDialog.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/views/credentials/AddEditCredentialDialog.jsx b/packages/ui/src/views/credentials/AddEditCredentialDialog.jsx index 32988c758cf..d1ca3d3cd62 100644 --- a/packages/ui/src/views/credentials/AddEditCredentialDialog.jsx +++ b/packages/ui/src/views/credentials/AddEditCredentialDialog.jsx @@ -24,6 +24,7 @@ import useApi from '@/hooks/useApi' // utils import useNotifier from '@/utils/useNotifier' +import { initializeDefaultNodeData } from '@/utils/genericHelper' // const import { baseURL, REDACTED_CREDENTIAL_VALUE } from '@/store/constant' @@ -95,7 +96,8 @@ const AddEditCredentialDialog = ({ show, dialogProps, onCancel, onConfirm, setEr // When credential dialog is to add a new credential setName('') setCredential({}) - setCredentialData({}) + const defaultCredentialData = initializeDefaultNodeData(dialogProps.credentialComponent.inputs) + setCredentialData(defaultCredentialData) setComponentCredential(dialogProps.credentialComponent) }