Unverified Commit 83704657 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #308 from anuraagdjain/fix/model-saving

fix(model-selector): prevent saving empty default model
parents 46f131cc 22a8fa2f
......@@ -6,6 +6,11 @@
export let disabled = false;
const saveDefaultModel = () => {
const hasEmptyModel = selectedModels.filter(it => it === '');
if(hasEmptyModel.length){
toast.error('Choose a model before saving...');
return;
}
settings.set({ ...$settings, models: selectedModels });
localStorage.setItem('settings', JSON.stringify($settings));
toast.success('Default model updated');
......@@ -21,7 +26,7 @@
bind:value={selectedModel}
{disabled}
>
<option class=" text-gray-700" value="" selected>Select a model</option>
<option class=" text-gray-700" value="" selected disabled>Select a model</option>
{#each $models as model}
{#if model.name === 'hr'}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment