Prevent presets without a max context/response value from unchecking unlocked context

This commit is contained in:
ThisIsPIRI 2024-03-08 17:12:53 +09:00
parent ae378789fe
commit 535126083e

View File

@ -5951,7 +5951,7 @@ async function saveSettings(type) {
}
export function setGenerationParamsFromPreset(preset) {
const needsUnlock = preset.max_length > MAX_CONTEXT_DEFAULT || preset.genamt > MAX_RESPONSE_DEFAULT;
const needsUnlock = (preset.max_length ?? max_context) > MAX_CONTEXT_DEFAULT || (preset.genamt ?? amount_gen) > MAX_RESPONSE_DEFAULT;
$('#max_context_unlocked').prop('checked', needsUnlock).trigger('change');
if (preset.genamt !== undefined) {