bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/actions-bar/service.js
2017-03-24 07:56:08 -07:00

35 lines
873 B
JavaScript
Executable File

import React from 'react';
import AuthSingleton from '/imports/ui/services/auth/index.js';
import Users from '/imports/api/users';
import { joinListenOnly } from '/imports/api/phone';
import { showModal } from '/imports/ui/components/app/service';
import { exitAudio } from '/imports/api/phone';
import Audio from '/imports/ui/components/audio-modal/component';
let isUserPresenter = () => {
// check if user is a presenter
let isPresenter = Users.findOne({
userId: AuthSingleton.userID,
}).user.presenter;
return {
isUserPresenter: isPresenter,
};
};
const handleExitAudio = () => {
return exitAudio();
}
const handleJoinAudio = () => {
const handleJoinListenOnly = () => joinListenOnly();
return showModal(<Audio handleJoinListenOnly={handleJoinListenOnly} />);
}
export default {
isUserPresenter,
handleJoinAudio,
handleExitAudio,
};