From 535126083ef01ef8b9907bfc48615b591f6a443f Mon Sep 17 00:00:00 2001 From: ThisIsPIRI Date: Fri, 8 Mar 2024 17:12:53 +0900 Subject: [PATCH] Prevent presets without a max context/response value from unchecking unlocked context --- public/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index 09739a990..49569572f 100644 --- a/public/script.js +++ b/public/script.js @@ -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) {