From 7512e5619735a5e785b19423abc8b950cec16e4d Mon Sep 17 00:00:00 2001 From: geetesha Date: Fri, 9 Aug 2024 23:50:33 -0700 Subject: [PATCH] fix random seed to max length of the sizes, and add custom sizes folder to the sizes searching function --- js/show-sizes.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/show-sizes.js b/js/show-sizes.js index 5b1dae1..794418f 100644 --- a/js/show-sizes.js +++ b/js/show-sizes.js @@ -74,9 +74,11 @@ const ext = { if (!sizes || !sizes.length) return; - sizeIndexWidget.options.max = sizes.length; - if(sizeIndexWidget.options.value > sizes.length) { - sizeIndexWidget.options.value = sizes.length; + const maxSeed = sizes.length - 1; + + sizeIndexWidget.options.max = maxSeed; + if(sizeIndexWidget.options.value > maxSeed) { + sizeIndexWidget.options.value = maxSeed; } this.triggerSlot(0);