From fed9bab2ea0675a2e0f3255a631cc9d0ee23835f Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Tue, 21 Oct 2025 08:50:34 -0600 Subject: [PATCH] Fixeds QR flashing --- docs/src/components/QRCode.astro | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/src/components/QRCode.astro b/docs/src/components/QRCode.astro index ec1c8a2..4194df2 100644 --- a/docs/src/components/QRCode.astro +++ b/docs/src/components/QRCode.astro @@ -46,7 +46,6 @@ const uniqueId = `qr-${Math.random().toString(36).substr(2, 9)}`; (darkModeQR || lightModeQR) && ( {alt} + (function () { + const img = document.getElementById(uniqueId); + if (!img) return; + + const theme = document.documentElement.getAttribute("data-theme"); + if (theme === "dark" && darkModeQR) { + img.setAttribute("src", darkModeQR); + } else if (lightModeQR) { + img.setAttribute("src", lightModeQR); + } + })(); + +