Add JSdoc for function

4a7a11dfd560c21ac99cf25bb9f4167cc75992e2

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +7 -2Showing whitespace changes
public/script.js+7 -2
@@ -6833,9 +6833,14 @@ export async function saveSettings(type) {
68336833 });
68346834}
68356835
6836-export function setGenerationParamsFromPreset(preset, keep_context_lock) {
6836+/**
6837+ * Sets the generation parameters from a preset object.
6838+ * @param {{ genamt?: number, max_length?: number }} preset Preset object
6839+ * @param {boolean?} keepContextLock If true, will not unlock context if it needs to be unlocked
6840+ */
6841+export function setGenerationParamsFromPreset(preset, keepContextLock = false) {
68376842 const needsUnlock = (preset.max_length ?? max_context) > MAX_CONTEXT_DEFAULT || (preset.genamt ?? amount_gen) > MAX_RESPONSE_DEFAULT;
68386843 if (!keep_context_lockkeepContextLock || $('#max_context_unlocked').prop('checked')) {
68396844 $('#max_context_unlocked').prop('checked', needsUnlock).trigger('change');
68406845 } else if (needsUnlock) {
68416846 // cap values