fix: 切换预设时 Think 按钮在模型不支持时不应显示激活态
This commit is contained in:
@@ -233,12 +233,11 @@ function syncPresetToUI(preset) {
|
|||||||
if (tempSlider) tempSlider.value = preset.temperature ?? 0.7;
|
if (tempSlider) tempSlider.value = preset.temperature ?? 0.7;
|
||||||
if (tempDisplay) tempDisplay.textContent = (preset.temperature ?? 0.7).toFixed(1);
|
if (tempDisplay) tempDisplay.textContent = (preset.temperature ?? 0.7).toFixed(1);
|
||||||
|
|
||||||
// Think toggle
|
// Think toggle — 仅在模型支持时才设为 checked,否则保持 unchecked
|
||||||
const thinkCheckbox = document.querySelector('#toggleThink');
|
const thinkCheckbox = document.querySelector('#toggleThink');
|
||||||
if (thinkCheckbox) {
|
if (thinkCheckbox) {
|
||||||
thinkCheckbox.checked = preset.think ?? false;
|
const modelSupportsThink = !thinkCheckbox.disabled;
|
||||||
// 触发 change 事件让 model-bar 响应
|
thinkCheckbox.checked = modelSupportsThink && (preset.think ?? false);
|
||||||
thinkCheckbox.dispatchEvent(new Event('change'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user