aboutsummaryrefslogblamecommitdiffhomepage
path: root/shared/extra-utils/videos/channels.ts
blob: 81e818094cb2b12a1bac303bc699526fe189cd6e (plain) (tree)
1
2
3
4
5
6
7
8
                                              




                                                         

                                                                     









                           
import { ServerInfo } from '../server/servers'

function setDefaultVideoChannel (servers: ServerInfo[]) {
  const tasks: Promise<any>[] = []

  for (const server of servers) {
    const p = server.users.getMyInfo()
      .then(user => { server.store.channel = user.videoChannels[0] })

    tasks.push(p)
  }

  return Promise.all(tasks)
}

export {
  setDefaultVideoChannel
}