X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fhelpers%2Futils.ts;h=d05541ca928e1d4d0cd4567e2a583d9717166310;hb=94676e631c5045144da598fefbefaa3cfcaaeb0d;hp=825b6ca9620efe118e2c0c593b5bbd6bd959b290;hpb=4504f09f6e85f09b0489debb547a17209d7176ea;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/helpers/utils.ts b/client/src/app/helpers/utils.ts index 825b6ca96..d05541ca9 100644 --- a/client/src/app/helpers/utils.ts +++ b/client/src/app/helpers/utils.ts @@ -1,4 +1,5 @@ import { DatePipe } from '@angular/common' +import { SelectChannelItem } from '@app/shared/shared-forms' import { environment } from '../../environments/environment' import { AuthService } from '../core/auth' @@ -16,7 +17,10 @@ function getParameterByName (name: string, url: string) { return decodeURIComponent(results[2].replace(/\+/g, ' ')) } -function populateAsyncUserVideoChannels (authService: AuthService, channel: { id: number, label: string, support?: string }[]) { +function populateAsyncUserVideoChannels ( + authService: AuthService, + channel: SelectChannelItem[] +) { return new Promise(res => { authService.userInformationLoaded .subscribe( @@ -27,7 +31,12 @@ function populateAsyncUserVideoChannels (authService: AuthService, channel: { id const videoChannels = user.videoChannels if (Array.isArray(videoChannels) === false) return - videoChannels.forEach(c => channel.push({ id: c.id, label: c.displayName, support: c.support })) + videoChannels.forEach(c => channel.push({ + id: c.id, + label: c.displayName, + support: c.support, + avatarPath: c.avatar?.path + })) return res() }