diff --git a/frontend/app/shared/components/notifo.component.ts b/frontend/app/shared/components/notifo.component.ts index 1ab5c72e0..d2c2929ca 100644 --- a/frontend/app/shared/components/notifo.component.ts +++ b/frontend/app/shared/components/notifo.component.ts @@ -44,18 +44,21 @@ export class NotifoComponent implements AfterViewInit, OnChanges, OnDestroy { } public ngAfterViewInit() { - if (this.notifoApiKey) { + const userToken = this.notifoApiKey; + + if (userToken) { let notifo = window['notifo']; if (!notifo) { notifo = []; + const options: any = { apiUrl: this.notifoApiUrl, userToken }; + if (this.notifoApiUrl.indexOf('localhost:5002') >= 0) { - notifo.push(['set', 'style', 'https://localhost:3002/notifo-sdk.css']); + options.styleUrl = 'https://localhost:3002/notifo-sdk.css'; } - notifo.push(['set', 'api-url', this.notifoApiUrl]); - notifo.push(['set', 'user-token', this.notifoApiKey]); + notifo.push(['init', options]); notifo.push(['subscribe']); window['notifo'] = notifo;