Project

General

Profile

« Previous | Next » 

Revision 55671

completed timezones list and removed not needed setTimeouts

View differences:

app.component.ts
2 2
import { NavigationEnd, Router, RoutesRecognized } from '@angular/router';
3 3
import { AuthenticationService } from './services/authentication.service';
4 4
import { environment } from '../environments/environment';
5
import { MatomoInjector } from 'ngx-matomo';
5
import { MatomoInjector, MatomoTracker } from 'ngx-matomo';
6 6

  
7 7
@Component({
8 8
  selector: 'oa-repo-manager',
......
12 12
export class AppComponent implements OnInit {
13 13
  constructor(private router: Router,
14 14
              private authService: AuthenticationService,
15
              private matomoInjector: MatomoInjector) {
15
              private matomoInjector: MatomoInjector,
16
              private matomoTracker: MatomoTracker) {
16 17

  
17 18
    console.log('11-02-2019. First deploy of project upgraded to angular 6');
18 19

  
......
47 48
  }
48 49

  
49 50
  ngOnInit() {
51
    if (this.authService.isLoggedIn) {
52
      this.matomoTracker.setUserId(this.authService.getUserEmail());
53
    }
50 54
    this.router.events.subscribe((evt) => {
51
      /*if ((evt instanceof RoutesRecognized) && (environment.production === true)) {
52
        let piwikUrl;
53
        if (window.location.origin.includes('beta')) {
54
          // piwikUrl = 'https://analytics.openaire.eu/piwik.php?idsite=92&rec=1';
55
          piwikUrl = '92';
56
        } else if (window.location.origin.includes('localhost:4200') ||
57
                   window.location.origin.includes('athenarc')) {
58
          // piwikUrl = 'https://analytics.openaire.eu/piwik.php?idsite=92&rec=1';
59
          piwikUrl = '9222222';
60
        } else {
61
          // piwikUrl = 'https://analytics.openaire.eu/piwik.php?idsite=111&rec=1';
62
          piwikUrl = '111';
63
        }
64
        this.matomoInjector.init('https://analytics.openaire.eu/', piwikUrl);
65
      }*/
66

  
67 55
      if (!(evt instanceof NavigationEnd)) {
68 56
        return;
69 57
      }

Also available in: Unified diff