Skip to content

Commit

Permalink
Merge pull request #387 from City-of-Helsinki/fix/matomo-config-enabled
Browse files Browse the repository at this point in the history
fix: env variable MATOMO_ENABLED should be string
  • Loading branch information
mikkojamG authored Mar 14, 2024
2 parents 24a33db + c06b579 commit 7bc4cae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ FEEDBACK_EMAILS=""
MATOMO_SRC_URL=""
MATOMO_URL_BASE=""
MATOMO_SITE_ID=""
MATOMO_ENABLED=false
MATOMO_ENABLED="false"
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const App = (): JSX.Element => {
urlBase: window?.ENV?.MATOMO_URL_BASE,
siteId: window?.ENV?.MATOMO_SITE_ID,
srcUrl: window?.ENV?.MATOMO_SRC_URL,
enabled: window?.ENV?.MATOMO_ENABLED,
enabled: window?.ENV?.MATOMO_ENABLED === 'true',
configurations: {
setDoNotTrack: true,
},
Expand Down
2 changes: 1 addition & 1 deletion src/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface Window {
MATOMO_SRC_URL: string;
MATOMO_URL_BASE: string;
MATOMO_SITE_ID: string;
MATOMO_ENABLED: boolean;
MATOMO_ENABLED: string;
};
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any
_paq: [string, ...any[]][];
Expand Down
2 changes: 1 addition & 1 deletion src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ window.ENV = {
MATOMO_SRC_URL: '',
MATOMO_URL_BASE: 'test',
MATOMO_SITE_ID: 'test123',
MATOMO_ENABLED: false,
MATOMO_ENABLED: 'false',
};

0 comments on commit 7bc4cae

Please sign in to comment.