From f8b2c1b4f509c037b9650cca2c5befd21f056df3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Dec 2018 16:04:34 +0100 Subject: Refractor notification service Shorter name and use primeng component --- client/src/app/core/auth/auth.service.ts | 9 ++++----- client/src/app/core/auth/index.ts | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'client/src/app/core/auth') diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index 5f5730e02..79ea32ced 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts @@ -3,7 +3,7 @@ import { catchError, map, mergeMap, share, tap } from 'rxjs/operators' import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { Router } from '@angular/router' -import { NotificationsService } from 'angular2-notifications' +import { Notifier } from '@app/core/notification' import { OAuthClientLocal, User as UserServerModel, UserRefreshToken } from '../../../../../shared' import { User } from '../../../../../shared/models/users' import { UserLogin } from '../../../../../shared/models/users/user-login.model' @@ -47,7 +47,7 @@ export class AuthService { constructor ( private http: HttpClient, - private notificationsService: NotificationsService, + private notifier: Notifier, private hotkeysService: HotkeysService, private restExtractor: RestExtractor, private router: Router, @@ -105,9 +105,8 @@ export class AuthService { ) } - // We put a bigger timeout - // This is an important message - this.notificationsService.error(this.i18n('Error'), errorMessage, { timeOut: 7000 }) + // We put a bigger timeout: this is an important message + this.notifier.error(errorMessage, this.i18n('Error'), 7000) } ) } diff --git a/client/src/app/core/auth/index.ts b/client/src/app/core/auth/index.ts index bc7bfec0e..8e5caa7ed 100644 --- a/client/src/app/core/auth/index.ts +++ b/client/src/app/core/auth/index.ts @@ -1,4 +1,3 @@ export * from './auth-status.model' export * from './auth-user.model' export * from './auth.service' -export * from '../routing/login-guard.service' -- cgit v1.2.3