bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/nav-bar/service.js

28 lines
632 B
JavaScript
Raw Normal View History

import Auth from '/imports/ui/services/auth';
2017-06-19 19:57:32 +08:00
import Breakouts from '/imports/api/1.1/breakouts';
2016-11-25 03:22:04 +08:00
const getBreakouts = () => Breakouts.find().fetch();
2016-11-29 03:48:02 +08:00
const getBreakoutJoinURL = (breakout) => {
const currentUserId = Auth.userID;
2016-11-29 03:48:02 +08:00
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,
2016-11-29 03:48:02 +08:00
getBreakoutJoinURL,
};