X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Baccounts%2Faccounts.component.ts;h=3118d7562d657b8804a121daf780661314dbc653;hb=fc2df421a99e87ad20ca1f758491b6af476efd56;hp=e19927d6b08b0a83204bb495f4848390f448ce42;hpb=54b3316099ed7d2dfcb6d708fdb686f1e125ce61;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index e19927d6b..3118d7562 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts @@ -5,10 +5,9 @@ import { Account } from '@app/shared/account/account.model' import { RestExtractor, UserService } from '@app/shared' import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators' import { Subscription } from 'rxjs' -import { NotificationsService } from 'angular2-notifications' +import { AuthService, Notifier, RedirectService } from '@app/core' import { User, UserRight } from '../../../../shared' import { I18n } from '@ngx-translate/i18n-polyfill' -import { AuthService, RedirectService } from '@app/core' @Component({ templateUrl: './accounts.component.html', @@ -24,7 +23,7 @@ export class AccountsComponent implements OnInit, OnDestroy { private route: ActivatedRoute, private userService: UserService, private accountService: AccountService, - private notificationsService: NotificationsService, + private notifier: Notifier, private restExtractor: RestExtractor, private redirectService: RedirectService, private authService: AuthService, @@ -43,7 +42,7 @@ export class AccountsComponent implements OnInit, OnDestroy { .subscribe( account => this.account = account, - err => this.notificationsService.error(this.i18n('Error'), err.message) + err => this.notifier.error(err.message) ) } @@ -59,6 +58,10 @@ export class AccountsComponent implements OnInit, OnDestroy { this.redirectService.redirectToHomepage() } + activateCopiedMessage () { + this.notifier.success(this.i18n('Username copied')) + } + private getUserIfNeeded (account: Account) { if (!account.userId) return if (!this.authService.isLoggedIn()) return @@ -69,7 +72,7 @@ export class AccountsComponent implements OnInit, OnDestroy { .subscribe( user => this.user = user, - err => this.notificationsService.error(this.i18n('Error'), err.message) + err => this.notifier.error(err.message) ) } }