Skip to content

Commit

Permalink
fix: For malformed viewType parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
micwallace committed Oct 9, 2024
1 parent 2af4d04 commit 8de957f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion javascript/tokenscript-viewer/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8de957f

Please sign in to comment.