Fix range validation error

This commit is contained in:
Cohee
2023-11-12 17:27:40 +02:00
parent 4558f856b5
commit dd12cacd16

View File

@ -1476,10 +1476,11 @@ function switchMaxContextSize() {
const steps = power_user.max_context_unlocked ? unlockedMaxContextStep : maxContextStep;
for (const element of elements) {
const id = element.attr('id');
element.attr('max', maxValue);
element.attr('step', steps);
if (element.attr('id').indexOf('max_context') !== -1) {
if (typeof id === 'string' && id?.indexOf('max_context') !== -1) {
element.attr('min', minValue);
}
const value = Number(element.val());