From 23a1b413304bde3fc74b97aad52ac058601f7bf2 Mon Sep 17 00:00:00 2001 From: pdxlocations Date: Thu, 26 Oct 2023 21:18:22 -0700 Subject: [PATCH 1/2] validation of string not URL --- src/components/Dialog/ImportDialog.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/Dialog/ImportDialog.tsx b/src/components/Dialog/ImportDialog.tsx index 0bde24a4..60d1ca0a 100644 --- a/src/components/Dialog/ImportDialog.tsx +++ b/src/components/Dialog/ImportDialog.tsx @@ -34,11 +34,12 @@ export const ImportDialog = ({ useEffect(() => { const base64String = QRCodeURL.split("e/#")[1] - ?.replace(/-/g, "+") - .replace(/_/g, "/") - .padEnd(QRCodeURL.length + ((4 - (QRCodeURL.length % 4)) % 4), "="); + const paddedString = base64String + ?.padEnd(base64String.length + ((4 - (base64String.length % 4)) % 4), "=") + .replace(/-/g, "+") + .replace(/_/g, "/"); try { - setChannelSet(Protobuf.ChannelSet.fromBinary(toByteArray(base64String))); + setChannelSet(Protobuf.ChannelSet.fromBinary(toByteArray(paddedString))); setValidURL(true); } catch (error) { setValidURL(false); From 437db3cb7f0a3164e9ef756b3cf709e854108fc0 Mon Sep 17 00:00:00 2001 From: pdxlocations Date: Thu, 26 Oct 2023 21:19:11 -0700 Subject: [PATCH 2/2] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e9ac63df..1b237c72 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshtastic-web", - "version": "2.2.12-0", + "version": "2.2.12-1", "type": "module", "description": "Meshtastic web client", "license": "GPL-3.0-only",