Skip to content

Commit

Permalink
fix(openAiKey): handle nullish values (#1080)
Browse files Browse the repository at this point in the history
  • Loading branch information
mamadoudicko authored Aug 31, 2023
1 parent aaf8411 commit 47b8d69
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,8 @@ export const useSettingsTab = ({ brainId }: UseSettingsTabProps) => {
continue;
}

if (
brainKey === "openai_api_key" &&
brain["openai_api_key"] !== undefined
) {
setValue("openAiKey", brain["openai_api_key"]);
if (brainKey === "openai_api_key") {
setValue("openAiKey", brain["openai_api_key"] ?? "");
continue;
}

Expand Down Expand Up @@ -333,7 +330,7 @@ export const useSettingsTab = ({ brainId }: UseSettingsTabProps) => {
return {
handleSubmit,
register,
openAiKey: openAiKey === "" ? undefined : openAiKey,
openAiKey,
model,
temperature,
maxTokens,
Expand Down

0 comments on commit 47b8d69

Please sign in to comment.