Browse Source

Fix QR code not being URL safe

pull/31/head
Sacha Weatherstone 4 years ago
parent
commit
b06bc2d20c
  1. 7
      src/components/Dialog/QRDialog.tsx

7
src/components/Dialog/QRDialog.tsx

@ -44,11 +44,14 @@ export const QRDialog = ({
settings: channelsToEncode, settings: channelsToEncode,
}) })
); );
const base64 = fromByteArray(encoded); const base64 = fromByteArray(encoded)
.replace(/=/g, "")
.replace(/\+/g, "-")
.replace(/\//g, "_");
setQRCodeURL(`https://www.meshtastic.org/e/#${base64}`); setQRCodeURL(`https://www.meshtastic.org/e/#${base64}`);
}, [channels, selectedChannels, loraConfig]); }, [channels, selectedChannels, loraConfig]);
return ( return (
<Dialog <Dialog
isShown={isOpen} isShown={isOpen}

Loading…
Cancel
Save