From 9d05c3d61c1b930843b1eaa72011a94b1363361f Mon Sep 17 00:00:00 2001 From: Agustin Groh Date: Fri, 15 Nov 2024 16:19:30 -0300 Subject: [PATCH] bug:FS-2183 Fixes API selector on scanoss SettingsDialog.tsx --- src/renderer/features/workspace/mappers.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/renderer/features/workspace/mappers.ts b/src/renderer/features/workspace/mappers.ts index 390c8c04..e8e56d8a 100644 --- a/src/renderer/features/workspace/mappers.ts +++ b/src/renderer/features/workspace/mappers.ts @@ -39,7 +39,6 @@ export const mapToGlobalSettingsFormValues = (cfg: IWorkspaceCfg): GlobalSetting HTTPS_PROXY, IGNORE_CERT_ERRORS, } = cfg; - const defaultApi = APIS && APIS[DEFAULT_API_INDEX] ? APIS[DEFAULT_API_INDEX] : null; const hasNoProxy = !HTTP_PROXY && !PAC_PROXY; @@ -52,9 +51,9 @@ export const mapToGlobalSettingsFormValues = (cfg: IWorkspaceCfg): GlobalSetting const sameConfigAsHttp = httpHost === httpsHost && httpPort === httpsPort; return { - apiKey: defaultApi.API_KEY, + apiKey: defaultApi?.API_KEY, apis: APIS || [], - apiUrl: defaultApi.URL, + apiUrl: defaultApi?.URL, language: LNG, sbomLedgerToken: TOKEN, proxyConfig: {