Skip to content

Commit

Permalink
fix: proper checks for default system prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
alashchev17 committed Feb 21, 2025
1 parent d21ddc6 commit a07db81
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions refact-agent/gui/src/components/ChatForm/PromptSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ export const PromptSelect: React.FC = () => {

const caps = useGetCapsQuery();

const default_system_prompt =
caps.data?.code_chat_default_system_prompt ?? "default";
const default_system_prompt = useMemo(() => {
if (
caps.data?.code_chat_default_system_prompt &&
caps.data.code_chat_default_system_prompt !== ""
) {
return caps.data.code_chat_default_system_prompt;
}
return "default";
}, [caps.data?.code_chat_default_system_prompt]);

const val = useMemo(
() => Object.keys(selectedSystemPrompt)[0] ?? default_system_prompt,
Expand Down

0 comments on commit a07db81

Please sign in to comment.