Skip to content

Commit 2e649d3

Browse files
author
Ravi Singh
committed
fix: larger QR code (280px) + scanner URL trim + return guard
1 parent f06ac7d commit 2e649d3

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

firmware/receiver-c3/components/web_server/web_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static const char DASHBOARD_HTML[] =
426426
/* Fallback: just show the URL text for manual entry */
427427
"const c=document.getElementById('qr-container');"
428428
"try{"
429-
"const size=200;"
429+
"const size=280;"
430430
"c.innerHTML=`<img src='https://api.qrserver.com/v1/create-qr-code/?size=${size}x${size}&data=${encodeURIComponent(d.url)}&bgcolor=FFFFFF&color=000000' "
431431
"width='${size}' height='${size}' alt='QR Code' style='image-rendering:pixelated' "
432432
"onerror=\"this.parentNode.innerHTML='<div style=color:#000;padding:2rem;font-size:.8rem>QR GENERATION FAILED<br>USE THE LINK BELOW</div>'\">`;"

firmware/receiver/components/web_server/web_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static const char DASHBOARD_HTML[] =
426426
/* Fallback: just show the URL text for manual entry */
427427
"const c=document.getElementById('qr-container');"
428428
"try{"
429-
"const size=200;"
429+
"const size=280;"
430430
"c.innerHTML=`<img src='https://api.qrserver.com/v1/create-qr-code/?size=${size}x${size}&data=${encodeURIComponent(d.url)}&bgcolor=FFFFFF&color=000000' "
431431
"width='${size}' height='${size}' alt='QR Code' style='image-rendering:pixelated' "
432432
"onerror=\"this.parentNode.innerHTML='<div style=color:#000;padding:2rem;font-size:.8rem>QR GENERATION FAILED<br>USE THE LINK BELOW</div>'\">`;"

pwa/client/src/pages/SetupWizard.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ export default function SetupWizard() {
5959
});
6060

6161
if (code && code.data) {
62+
const scanned = code.data.trim();
6263
try {
63-
const parsed = new URL(code.data);
64-
// New format: http://<ip>/claim — open directly (receiver handles redirect)
64+
const parsed = new URL(scanned);
65+
// New format: http://<ip>/claim
6566
if (parsed.pathname === '/claim') {
6667
stopScan();
67-
window.location.href = code.data;
68+
window.location.href = scanned;
69+
return;
6870
}
6971
// Old format: https://cloud/link?id=...&token=...&ip=...
7072
const id = parsed.searchParams.get('id');
@@ -73,6 +75,7 @@ export default function SetupWizard() {
7375
if (id && token && ip) {
7476
stopScan();
7577
window.location.href = `/link?id=${id}&token=${token}&ip=${ip}`;
78+
return;
7679
}
7780
} catch {} // Not a valid URL — keep scanning
7881
}

0 commit comments

Comments
 (0)