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 --- client/src/app/+accounts/accounts.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'client/src/app/+accounts/accounts.component.ts') 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