Skip to content

Commit

Permalink
fix: Settings modal properly tracks if an API key is set (#6394)
Browse files Browse the repository at this point in the history
Co-authored-by: Calvin Smith <[email protected]>
  • Loading branch information
csmith49 and Calvin Smith authored Jan 21, 2025
1 parent 5b7fcfb commit 8bd7613
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe("Sidebar", () => {
await user.click(advancedOptionsSwitch);

const apiKeyInput = within(settingsModal).getByLabelText(/API\$KEY/i);
await user.type(apiKeyInput, "SET");
await user.type(apiKeyInput, "**********");

const saveButton = within(settingsModal).getByTestId(
"save-settings-button",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function SettingsForm({

<APIKeyInput
isDisabled={!!disabled}
isSet={settings.LLM_API_KEY === "SET"}
isSet={settings.LLM_API_KEY === "**********"}
/>

{showAdvancedOptions && (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/context/settings-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function SettingsProvider({ children }: SettingsProviderProps) {
...newSettings,
};

if (updatedSettings.LLM_API_KEY === "SET") {
if (updatedSettings.LLM_API_KEY === "**********") {
delete updatedSettings.LLM_API_KEY;
}

Expand Down

0 comments on commit 8bd7613

Please sign in to comment.