diff --git a/javascript/qrcode.js b/javascript/qrcode.js index cea0e08..36db8ef 100644 --- a/javascript/qrcode.js +++ b/javascript/qrcode.js @@ -73,11 +73,7 @@ async function sendToControlnet(img, tab, index) { function setImage(input, list) { try { - if (input.previousElementSibling && - input.previousElementSibling.previousElementSibling && - input.previousElementSibling.previousElementSibling.querySelector("button[aria-label='Clear']")) { - input.previousElementSibling.previousElementSibling.querySelector("button[aria-label='Clear']").click() - } + input.previousElementSibling?.previousElementSibling?.querySelector("button[aria-label='Clear']")?.click() } catch (e) { console.error(e) }