From a15a69c5a1d06e974533795284eddb72de99d85b Mon Sep 17 00:00:00 2001 From: Andrew Ballantyne <8126518+andrewballantyne@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:50:12 -0400 Subject: [PATCH] Cleanup the existing secret field functionality (#3327) --- .../trustyai/content/TrustyDBExistingSecretField.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/concepts/trustyai/content/TrustyDBExistingSecretField.tsx b/frontend/src/concepts/trustyai/content/TrustyDBExistingSecretField.tsx index 08d0aa239a..2e3634898d 100644 --- a/frontend/src/concepts/trustyai/content/TrustyDBExistingSecretField.tsx +++ b/frontend/src/concepts/trustyai/content/TrustyDBExistingSecretField.tsx @@ -62,11 +62,14 @@ const TrustyDBExistingSecretField: React.FC = value={data} onChange={(e, value) => { delayCheckState(); - onDataChange(value); + onDataChange(value.trim()); }} onBlur={() => { - delayCheckState.cancel(); - onCheckState(); + if (state !== TrustyInstallModalFormExistingState.EXISTING) { + // If you're not already validated, cancel exiting efforts and check now + delayCheckState.cancel(); + onCheckState(); + } }} validated={inputState} />