aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+accounts/account-video-channels/account-video-channels.component.ts')
-rw-r--r--client/src/app/+accounts/account-video-channels/account-video-channels.component.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
index 4c5782f9d..0852c4bb7 100644
--- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
+++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
@@ -1,11 +1,10 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute } from '@angular/router' 2import { ActivatedRoute } from '@angular/router'
3import 'rxjs/add/observable/from'
4import 'rxjs/add/operator/concatAll'
5import { Account } from '@app/shared/account/account.model' 3import { Account } from '@app/shared/account/account.model'
6import { AccountService } from '@app/shared/account/account.service' 4import { AccountService } from '@app/shared/account/account.service'
7import { VideoChannel } from '../../../../../shared/models/videos' 5import { VideoChannel } from '../../../../../shared/models/videos'
8import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' 6import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
7import { flatMap, map, tap } from 'rxjs/operators'
9 8
10@Component({ 9@Component({
11 selector: 'my-account-video-channels', 10 selector: 'my-account-video-channels',
@@ -25,9 +24,11 @@ export class AccountVideoChannelsComponent implements OnInit {
25 ngOnInit () { 24 ngOnInit () {
26 // Parent get the account for us 25 // Parent get the account for us
27 this.accountService.accountLoaded 26 this.accountService.accountLoaded
28 .do(account => this.account = account) 27 .pipe(
29 .flatMap(account => this.videoChannelService.listAccountVideoChannels(account.id)) 28 tap(account => this.account = account),
30 .map(res => res.data) 29 flatMap(account => this.videoChannelService.listAccountVideoChannels(account.id)),
30 map(res => res.data)
31 )
31 .subscribe(videoChannels => this.videoChannels = videoChannels) 32 .subscribe(videoChannels => this.videoChannels = videoChannels)
32 } 33 }
33} 34}