fixing border on startup. see #603

This commit is contained in:
Mic 2026-02-03 01:13:00 +01:00
parent 3e176f00b1
commit 73d6fdedc8
2 changed files with 5 additions and 9 deletions

View file

@ -25,6 +25,7 @@ import {
getChatGPTWebModelsList_HTML, getChatGPTWebModelsList_HTML,
isAPIKeyValue, isAPIKeyValue,
getConnectionType, getConnectionType,
setTomSelectBorder
} from '../js/mzta-utils.js'; } from '../js/mzta-utils.js';
import { import {
injectConnectionUI, injectConnectionUI,
@ -103,6 +104,7 @@ async function restoreOptions() {
} }
if (element.tomselect) { if (element.tomselect) {
element.tomselect.setValue(element.value, true); element.tomselect.setValue(element.value, true);
setTomSelectBorder(element.tomselect);
} }
break; break;
case 'textarea': case 'textarea':

View file

@ -30,7 +30,8 @@ import {
validateCustomData_ChatGPTWeb, validateCustomData_ChatGPTWeb,
sanitizeChatGPTModelData, sanitizeChatGPTModelData,
sanitizeChatGPTWebCustomData, sanitizeChatGPTWebCustomData,
prepareOriginURL prepareOriginURL,
setTomSelectBorder
} from '../../js/mzta-utils.js'; } from '../../js/mzta-utils.js';
import { openAICompConfigs } from '../../js/api/openai_comp_configs.js'; import { openAICompConfigs } from '../../js/api/openai_comp_configs.js';
import { import {
@ -1043,6 +1044,7 @@ export async function injectConnectionUI({
if (el.value) { if (el.value) {
ts.setValue(el.value); ts.setValue(el.value);
} }
console.log(">>>>>>>>>>>>>>> el.value: " + el.value);
setTomSelectBorder(ts); setTomSelectBorder(ts);
} }
}); });
@ -1261,14 +1263,6 @@ function toggleTomSelectDisabled(element, disabled) {
} }
} }
function setTomSelectBorder(el){
if (el.getValue() === "") {
el.control.style.border = '2px solid red';
} else {
el.control.style.border = '1px solid #d0d0d0';
}
}
function getModelEl(model, modelId_prefix) { function getModelEl(model, modelId_prefix) {
return document.getElementById((modelId_prefix ? modelId_prefix : '') + model); return document.getElementById((modelId_prefix ? modelId_prefix : '') + model);
} }