From 8de957f028bc4d359377876c5f9ad4001430a6dd Mon Sep 17 00:00:00 2001 From: Michael Wallace Date: Wed, 9 Oct 2024 14:16:08 +1100 Subject: [PATCH] fix: For malformed viewType parameter --- javascript/tokenscript-viewer/src/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/javascript/tokenscript-viewer/src/index.html b/javascript/tokenscript-viewer/src/index.html index 08444be..d986811 100644 --- a/javascript/tokenscript-viewer/src/index.html +++ b/javascript/tokenscript-viewer/src/index.html @@ -31,8 +31,13 @@ const query = new URLSearchParams(document.location.search.substring(1)); + let viewerType = query.has("viewType") ? query.get("viewType") : "default"; + + if (viewerType.includes("?")) + viewerType = viewerType.split("?")[0]; + gtag('config', 'G-0YTFX5PTEZ', { - 'viewer_type': query.has("viewType") ? query.get("viewType") : "default", + 'viewer_type': viewerType, 'chain': query.get("chain"), 'contract': "evm:" + query.get("contract"), 'scriptId': query.get("scriptId")