Skip to content

Commit

Permalink
bug:FS-2183 Fixes API selector on scanoss SettingsDialog.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
agustingroh committed Nov 15, 2024
1 parent 8b35e05 commit 0eb4295
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/renderer/features/workspace/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ 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 defaultApi = APIS && DEFAULT_API_INDEX >= 0 && APIS[DEFAULT_API_INDEX] ? APIS[DEFAULT_API_INDEX] : null;

const hasNoProxy = !HTTP_PROXY && !PAC_PROXY;
const initialProxyMode = hasNoProxy ? ProxyMode.NoProxy : PAC_PROXY ? ProxyMode.Automatic : ProxyMode.Manual;
Expand All @@ -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: {
Expand Down

0 comments on commit 0eb4295

Please sign in to comment.