Fix configured QR control URL at startup

This commit is contained in:
2026-08-03 22:05:46 -05:00
parent 50315bcc9e
commit 11521ff80a
4 changed files with 8 additions and 5 deletions
+3 -1
View File
@@ -97,7 +97,9 @@ Module.register("MMM-NextcloudCookbook", {
const qrLabel = document.createElement("span");
qrLabel.textContent = "Recipe mode control:";
const qrImage = document.createElement("img");
qrImage.src = "/MMM-NextcloudCookbook/qr.svg";
const qrParameters = new URLSearchParams();
if (this.config.controlUrl) qrParameters.set("url", this.config.controlUrl);
qrImage.src = `/MMM-NextcloudCookbook/qr.svg${qrParameters.size ? `?${qrParameters}` : ""}`;
qrImage.alt = "Recipe controller QR code";
qr.append(qrLabel, qrImage);
root.appendChild(qr);