Skip to content

Commit

Permalink
refactor: improve variable substitution in script
Browse files Browse the repository at this point in the history
  • Loading branch information
olros committed Apr 8, 2024
1 parent 27ce23f commit c95b308
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions web/app/routes/script[.js].ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 = {
Expand Down

0 comments on commit c95b308

Please sign in to comment.