From 4d85411aee0311b8d192dee82ed0b883378498a7 Mon Sep 17 00:00:00 2001 From: Rhys Yang Date: Tue, 16 Jan 2024 02:15:01 +0800 Subject: [PATCH] Fix the error message caused by aspect_ratio --- js/parameterDisplay.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/parameterDisplay.js b/js/parameterDisplay.js index 4563e29..a0c4c1a 100644 --- a/js/parameterDisplay.js +++ b/js/parameterDisplay.js @@ -59,10 +59,11 @@ Refiner start at step: ${message.text[6]} (${base_percentage})`; return `${ratio} - ${width*scalingFactor}x${height*scalingFactor}`; }); aspectRatioArray.unshift("custom") - - const aspectRatio = `${message.text[0]} - ${message.text[8][message.text[0]][0]*scalingFactor}x${message.text[8][message.text[0]][1]*scalingFactor}` + if (message.text[0] !== "custom") { + const aspectRatio = `${message.text[0]} - ${message.text[8][message.text[0]][0]*scalingFactor}x${message.text[8][message.text[0]][1]*scalingFactor}` + this.widgets.find(obj => obj.name === "aspect_ratio").value = aspectRatio + } this.widgets.find(obj => obj.name === "aspect_ratio").options.values = aspectRatioArray - this.widgets.find(obj => obj.name === "aspect_ratio").value = aspectRatio }; } },