diff options
| author | Adam Soltys <[email protected]> | 2026-06-25 16:09:38 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-25 16:09:38 -0700 |
| commit | 89828ed523015f426eb575cb69dceb83ae263d06 (patch) | |
| tree | efe2345f37d6b15b21e223d8bf2d6dc60cc9fde7 /src/qr.js | |
| parent | 656a8110d30fb0774902dbd6e92c173f5f6b072c (diff) | |
| download | coinosv3-89828ed523015f426eb575cb69dceb83ae263d06.tar.gz coinosv3-89828ed523015f426eb575cb69dceb83ae263d06.zip | |
Gift QR: use error-correction level L for a less dense, easier-to-scan grid
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'src/qr.js')
| -rw-r--r-- | src/qr.js | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -3,8 +3,11 @@ import qrcode from 'qrcode-generator'; -export function qrSvg(text, { margin = 2 } = {}) { - const qr = qrcode(0, 'M'); // type 0 = auto-size, error correction M +// ec: error-correction level. 'M' by default; pass 'L' for long payloads (e.g. +// gift links) where a smaller, chunkier grid scans more easily — on-screen QRs +// are scanned immediately and don't need the damage tolerance of higher levels. +export function qrSvg(text, { margin = 2, ec = 'M' } = {}) { + const qr = qrcode(0, ec); // type 0 = auto-size qr.addData(text); qr.make(); |
