Move the create agent button to the bottom of the sidebar and fix experience when resetting settings

This commit is contained in:
sabaimran
2025-02-12 19:24:02 -08:00
parent d0d30ace06
commit 848a91313d
2 changed files with 151 additions and 135 deletions

View File

@@ -67,6 +67,15 @@ export function ModelSelector({ ...props }: ModelSelectorProps) {
const model = models.find(model => model.name === props.selectedModel);
setSelectedModel(model);
}
else if (props.selectedModel === null && userConfig) {
const selectedChatModelOption = userConfig.chat_model_options.find(model => model.id === userConfig.selected_chat_model_config);
if (!selectedChatModelOption) {
props.onSelect(userConfig.chat_model_options[0], false);
return;
} else {
props.onSelect(selectedChatModelOption, false);
}
}
}, [props.selectedModel, models]);
useEffect(() => {