From ce087486c0eeec24fb4daf829dfdc40c8c67485e Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Fri, 4 Oct 2024 08:37:51 +0200 Subject: [PATCH] Thank You Typescript --- app/components/Models.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/Models.tsx b/app/components/Models.tsx index 2c56cae..697e32a 100644 --- a/app/components/Models.tsx +++ b/app/components/Models.tsx @@ -225,6 +225,8 @@ const ModelSection: React.FC = () => { const newModel = event.target.value; setSelectedModelDropdown(newModel); localStorage.setItem('selectedModelDropdown', newModel); // Update localStorage directly + var model = localStorage.getItem('activeSelectedAIFunction') || "Code" + modelClicked(model) }; // Determine the filtered models based on current radioSelection @@ -285,7 +287,8 @@ const ModelSection: React.FC = () => { const modelClicked = (model: string) => { localStorage.setItem('activeSelectedAIFunction', model) setActiveSelectedAIFunction(model) - const selectedAIFunction = selectedModelDropdown as keyof typeof modelList; + var modelDropdown = localStorage.getItem('selectedModelDropdown') || 'Offline Fast' + const selectedAIFunction = modelDropdown as keyof typeof modelList; localStorage.setItem("model", modelList[selectedAIFunction][model as keyof typeof modelList[typeof selectedAIFunction]]) localStorage.setItem("type", modelList[selectedAIFunction]['model_type' as keyof typeof modelList[typeof selectedAIFunction]]) }