From 9270ccf6dca5b2955ad126947d4296deb385fdcb Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Wed, 8 Jan 2020 22:13:47 +0100 Subject: Make subscribe buttons observe subscription statuses to synchronise --- .../account-video-channels.component.html | 6 +----- client/src/app/+accounts/accounts.component.html | 7 +------ client/src/app/+accounts/accounts.component.ts | 12 ++++++------ 3 files changed, 8 insertions(+), 17 deletions(-) (limited to 'client/src/app/+accounts') diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.html b/client/src/app/+accounts/account-video-channels/account-video-channels.component.html index 93f43a350..781156840 100644 --- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.html +++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.html @@ -9,11 +9,7 @@ Avatar
{{ videoChannel.displayName }}
-
{{ videoChannel.followersCount }} - - subscriber - subscribers -
+
{videoChannel.followersCount, plural, =1 {1 subscriber} other {{{ videoChannel.followersCount }} subscribers}}
diff --git a/client/src/app/+accounts/accounts.component.html b/client/src/app/+accounts/accounts.component.html index 1b6eb480e..be40b63ca 100644 --- a/client/src/app/+accounts/accounts.component.html +++ b/client/src/app/+accounts/accounts.component.html @@ -28,12 +28,7 @@ > -
- {{ account.followersCount }} - - subscriber - subscribers -
+
{account.followersCount, plural, =1 {1 subscriber} other {{{ account.followersCount }} subscribers}}
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index e3a503f4c..8bde7ad07 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts @@ -40,15 +40,15 @@ export class AccountsComponent implements OnInit, OnDestroy { map(params => params[ 'accountId' ]), distinctUntilChanged(), switchMap(accountId => this.accountService.getAccount(accountId)), - tap(account => this.getUserIfNeeded(account)), + tap(account => { + this.account = account + this.getUserIfNeeded(account) + }), + switchMap(account => this.videoChannelService.listAccountVideoChannels(account)), catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 404 ])) ) .subscribe( - account => { - this.account = account - this.videoChannelService.listAccountVideoChannels(account) - .subscribe(videoChannels => this.videoChannels = videoChannels.data) - }, + videoChannels => this.videoChannels = videoChannels.data, err => this.notifier.error(err.message) ) -- cgit v1.2.3