From c95b308e722b8873deed17a94fdb8b0bd3948287 Mon Sep 17 00:00:00 2001 From: Olaf Rosendahl Date: Mon, 8 Apr 2024 08:56:11 +0200 Subject: [PATCH] refactor: improve variable substitution in script --- web/app/routes/script[.js].ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/app/routes/script[.js].ts b/web/app/routes/script[.js].ts index dc93b67..55b1c91 100644 --- a/web/app/routes/script[.js].ts +++ b/web/app/routes/script[.js].ts @@ -2,7 +2,6 @@ import { minify } from 'uglify-js'; const __FALLBACK_BASE_URL__ = '__FALLBACK_BASE_URL__'; const pageviewScript = () => { - const fallbackBaseUrl = __FALLBACK_BASE_URL__; try { const host = location.host; const script = document.currentScript; @@ -14,7 +13,7 @@ const pageviewScript = () => { const pathname = script.getAttribute('data-pathname') || location.pathname; const team = script.getAttribute('data-team'); const project = script.getAttribute('data-project'); - const baseUrl = script.getAttribute('data-baseurl') || `${fallbackBaseUrl}`; + const baseUrl = script.getAttribute('data-baseurl') || __FALLBACK_BASE_URL__; if (!team || !project) return; const data = {