Skip to content

Commit

Permalink
fix code for retrieving piwik siteId from environment variable (#21)
Browse files Browse the repository at this point in the history
Co-authored-by: Amy Chen <[email protected]>
  • Loading branch information
achen2401 and Amy Chen authored Feb 10, 2025
1 parent 112aa75 commit 50cf69d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ui-client/src/utils/piwik.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ export function getUserIdFromEnv(config) : number | string | null {
return null;
}
// get PIWIK siteId from environment variable
export function getMatomoSiteIdFromEnv(config) : number | null{
if (!config) return null;
const envs = config.client ? config.client: config;
// appsettings.json {client: .....}
// env.json
export function getMatomoSiteIdFromEnv(envs) : number | null{
if (!envs) return null;
if (envs["REACT_APP_MATOMO_SITE_ID"]) return envs["REACT_APP_MATOMO_SITE_ID"];
if (envs["MATOMO_SITE_ID"]) return envs["MATOMO_SITE_ID"];
if (envs["REACT_APP_PIWIK_SITE_ID"]) return envs["REACT_APP_PIWIK_SITE_ID"];
Expand Down

0 comments on commit 50cf69d

Please sign in to comment.