bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/nav-bar/service.js
2016-11-28 17:48:02 -02:00

28 lines
654 B
JavaScript

import Auth from '/imports/ui/services/auth';
import Breakouts from '/imports/api/breakouts';
const getBreakouts = () => Breakouts.find().fetch();
const getBreakoutJoinURL = (breakout) => {
const currentUserId = Auth.getCredentials().requesterUserId;
if (breakout.users) {
const user = breakout.users.find(user => user.userId === currentUserId);
if (user) {
const urlParams = user.urlParams;
return [
window.origin,
'html5client/join',
urlParams.meetingId,
urlParams.userId,
urlParams.authToken,
].join('/');
}
}
};
export default {
getBreakouts,
getBreakoutJoinURL,
};