aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+accounts/accounts.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-19 15:14:13 +0200
committerChocobozzz <me@florianbigard.com>2019-06-19 15:14:13 +0200
commitee1d0dfb6d179d8742b6a3eb6ffce6a08fb16c9f (patch)
tree8a30a4b24018b3443c1f5c52a15d565189292b75 /client/src/app/+accounts/accounts.component.ts
parentccfcdb6785111685d4385e345545b6f89520a9a0 (diff)
downloadPeerTube-ee1d0dfb6d179d8742b6a3eb6ffce6a08fb16c9f.tar.gz
PeerTube-ee1d0dfb6d179d8742b6a3eb6ffce6a08fb16c9f.tar.zst
PeerTube-ee1d0dfb6d179d8742b6a3eb6ffce6a08fb16c9f.zip
Improve account username copy button
Diffstat (limited to 'client/src/app/+accounts/accounts.component.ts')
-rw-r--r--client/src/app/+accounts/accounts.component.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts
index d9786fb5c..3118d7562 100644
--- a/client/src/app/+accounts/accounts.component.ts
+++ b/client/src/app/+accounts/accounts.component.ts
@@ -7,6 +7,7 @@ import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/oper
7import { Subscription } from 'rxjs' 7import { Subscription } from 'rxjs'
8import { AuthService, Notifier, RedirectService } from '@app/core' 8import { AuthService, Notifier, RedirectService } from '@app/core'
9import { User, UserRight } from '../../../../shared' 9import { User, UserRight } from '../../../../shared'
10import { I18n } from '@ngx-translate/i18n-polyfill'
10 11
11@Component({ 12@Component({
12 templateUrl: './accounts.component.html', 13 templateUrl: './accounts.component.html',
@@ -25,7 +26,8 @@ export class AccountsComponent implements OnInit, OnDestroy {
25 private notifier: Notifier, 26 private notifier: Notifier,
26 private restExtractor: RestExtractor, 27 private restExtractor: RestExtractor,
27 private redirectService: RedirectService, 28 private redirectService: RedirectService,
28 private authService: AuthService 29 private authService: AuthService,
30 private i18n: I18n
29 ) {} 31 ) {}
30 32
31 ngOnInit () { 33 ngOnInit () {
@@ -56,6 +58,10 @@ export class AccountsComponent implements OnInit, OnDestroy {
56 this.redirectService.redirectToHomepage() 58 this.redirectService.redirectToHomepage()
57 } 59 }
58 60
61 activateCopiedMessage () {
62 this.notifier.success(this.i18n('Username copied'))
63 }
64
59 private getUserIfNeeded (account: Account) { 65 private getUserIfNeeded (account: Account) {
60 if (!account.userId) return 66 if (!account.userId) return
61 if (!this.authService.isLoggedIn()) return 67 if (!this.authService.isLoggedIn()) return