File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -19,3 +19,15 @@ declare module "rickshaw" {
1919 const Rickshaw : any
2020 export default Rickshaw
2121}
22+
23+ interface Window {
24+ /** Matomo action queue */
25+ _paq ?: any [ ]
26+ }
27+
28+ // Type of process.env
29+ namespace NodeJS {
30+ interface ProcessEnv {
31+ ENVIRONMENT : "development" | "staging" | "production"
32+ }
33+ }
Original file line number Diff line number Diff line change 55import settings from "@/settings"
66
77// Allow environment-specific (development/staging/production) settings or fallback to general settings
8- const matomoSettings = { ...settings [ "matomo" ] , ...settings [ "matomo" ] ?. [ process . env . ENVIRONMENT ] }
8+ const matomoSettings = {
9+ ...settings . matomo ,
10+ ...settings . matomo ?. [ process . env . ENVIRONMENT ] ,
11+ }
912
10- if ( matomoSettings ?. [ " url" ] && matomoSettings ?. [ " site" ] ) {
13+ if ( matomoSettings . url && matomoSettings . site ) {
1114 /** Matomo message queue */
1215 var _paq = ( window . _paq = window . _paq || [ ] )
1316 _paq . push ( [ "trackPageView" ] )
@@ -24,6 +27,6 @@ if (matomoSettings?.["url"] && matomoSettings?.["site"]) {
2427 g . type = "text/javascript"
2528 g . async = true
2629 g . src = u + "matomo.js"
27- s . parentNode . insertBefore ( g , s )
30+ s . parentNode ! . insertBefore ( g , s )
2831 } ) ( )
2932}
You can’t perform that action at this time.
0 commit comments