From 4868e10dbab158c2033644e33af569a201ce130d Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Wed, 27 Nov 2024 16:53:13 +0100 Subject: [PATCH] fix(frontend): Fix missing credentials input when no credentials available Fixes breakage from f1414550 (#8772) --- .../integrations/credentials-provider.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/autogpt_platform/frontend/src/components/integrations/credentials-provider.tsx b/autogpt_platform/frontend/src/components/integrations/credentials-provider.tsx index aeab8f48c38f..9fbae4b1fa92 100644 --- a/autogpt_platform/frontend/src/components/integrations/credentials-provider.tsx +++ b/autogpt_platform/frontend/src/components/integrations/credentials-provider.tsx @@ -208,15 +208,16 @@ export default function CredentialsProvider({ setProviders((prev) => ({ ...prev, - ...Object.entries(credentialsByProvider).reduce( - (acc, [provider, { apiKeys, oauthCreds }]) => ({ - ...acc, - [provider]: { + ...Object.fromEntries( + CREDENTIALS_PROVIDER_NAMES.map((provider) => [ + provider, + { provider, providerName: providerDisplayNames[provider as CredentialsProviderName], - savedApiKeys: apiKeys, - savedOAuthCredentials: oauthCreds, + savedApiKeys: credentialsByProvider[provider]?.apiKeys ?? [], + savedOAuthCredentials: + credentialsByProvider[provider]?.oauthCreds ?? [], oAuthCallback: (code: string, state_token: string) => oAuthCallback( provider as CredentialsProviderName, @@ -237,8 +238,7 @@ export default function CredentialsProvider({ force, ), }, - }), - {}, + ]), ), })); });