1 import { first, map } from 'rxjs/operators'
2 import { SelectChannelItem } from 'src/types/select-options-item.model'
3 import { AuthService } from '../../core/auth'
5 function listUserChannels (authService: AuthService) {
6 return authService.userInformationLoaded
10 const user = authService.getUser()
11 if (!user) return undefined
13 const videoChannels = user.videoChannels
14 if (Array.isArray(videoChannels) === false) return undefined
18 if (a.updatedAt < b.updatedAt) return 1
19 if (a.updatedAt > b.updatedAt) return -1
26 avatarPath: c.avatar?.path
27 }) as SelectChannelItem)