fix: 切换预设时 Think 按钮在模型不支持时不应显示激活态

This commit is contained in:
thzxx
2026-04-05 20:15:46 +08:00
parent ac3d7a3685
commit 27340d36b3
+3 -4
View File
@@ -233,12 +233,11 @@ function syncPresetToUI(preset) {
if (tempSlider) tempSlider.value = preset.temperature ?? 0.7;
if (tempDisplay) tempDisplay.textContent = (preset.temperature ?? 0.7).toFixed(1);
// Think toggle
// Think toggle — 仅在模型支持时才设为 checked,否则保持 unchecked
const thinkCheckbox = document.querySelector('#toggleThink');
if (thinkCheckbox) {
thinkCheckbox.checked = preset.think ?? false;
// 触发 change 事件让 model-bar 响应
thinkCheckbox.dispatchEvent(new Event('change'));
const modelSupportsThink = !thinkCheckbox.disabled;
thinkCheckbox.checked = modelSupportsThink && (preset.think ?? false);
}
}