bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/nav-bar/service.js
2017-08-11 14:14:50 -03:00

27 lines
595 B
JavaScript

import Auth from '/imports/ui/services/auth';
import Breakouts from '/imports/api/2.0/breakouts';
const getBreakouts = () => Breakouts.find().fetch();
const getBreakoutJoinURL = (breakout) => {
const currentUserId = Auth.userID;
if (breakout.users) {
const user = breakout.users.find(u => u.userId === currentUserId);
if (user) {
const urlParams = user.urlParams;
return [
window.origin,
`html5client/join?sessionToken=${urlParams.sessionToken}`,
].join('/');
}
}
return '';
};
export default {
getBreakouts,
getBreakoutJoinURL,
};