Skip to content

Commit 044c41c

Browse files
committed
removed comments, fix error
1 parent eec6072 commit 044c41c

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

src/app/item-page/clarin-matomo-statistics/clarin-matomo-statistics.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff 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

src/main.browser.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)