mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix(ui): persist selected model across playground navigation
Read selectedModel from sessionStorage on initialization so the model selection survives navigating away from and back to the playground page. The value was already being saved to sessionStorage on change but never restored on mount. Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
This commit is contained in:
parent
2d24b48e56
commit
c96f8a0cad
1 changed files with 4 additions and 1 deletions
|
|
@ -157,7 +157,10 @@ const ChatUI: React.FC<ChatUIProps> = ({
|
|||
return [];
|
||||
}
|
||||
});
|
||||
const [selectedModel, setSelectedModel] = useState<string | undefined>(simplified ? fixedModel : undefined);
|
||||
const [selectedModel, setSelectedModel] = useState<string | undefined>(() => {
|
||||
if (simplified) return fixedModel;
|
||||
return sessionStorage.getItem("selectedModel") || undefined;
|
||||
});
|
||||
const [showCustomModelInput, setShowCustomModelInput] = useState<boolean>(false);
|
||||
const [modelInfo, setModelInfo] = useState<ModelGroup[]>([]);
|
||||
const [agentInfo, setAgentInfo] = useState<Agent[]>([]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue