File tree Expand file tree Collapse file tree
app/item-page/clarin-matomo-statistics Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ export class ClarinMatomoStatisticsComponent implements OnInit {
2727 @ViewChild ( BaseChartDirective , { static : true } ) chart : BaseChartDirective ;
2828
2929 itemRD$ : BehaviorSubject < Item > = new BehaviorSubject < Item > ( null ) ;
30-
31- // Flag to track if Matomo is enabled
30+
3231 public matomoEnabled = false ;
3332
3433 // Month shortcut with full name
@@ -134,7 +133,6 @@ export class ClarinMatomoStatisticsComponent implements OnInit {
134133
135134
136135 ngOnInit ( ) : void {
137- // Check if Matomo is enabled in the environment
138136 this . matomoEnabled = environment . matomo ?. enabled === true ;
139137
140138 // If Matomo is disabled, don't fetch statistics
Original file line number Diff line number Diff line change @@ -65,12 +65,7 @@ function addMatomoStatistics() {
6565 g . src = environment . matomo . hostUrl + 'matomo.js' ;
6666 document . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( g ) ;
6767 } catch ( error ) {
68- // Log error unless in a test environment to aid debugging in production
69- if ( ! ( 'test' in environment && environment . test ) ) {
70- // Log the error to the console for visibility in production and development
71- console . error ( 'Matomo initialization failed:' , error ) ;
72- }
73- // Silently fail in test environments to avoid interfering with tests
68+ console . error ( 'Matomo initialization failed:' , error ) ;
7469 return ;
7570 }
7671}
You can’t perform that action at this time.
0 commit comments