From f90a1d446fdb0a299fd5674398d26fb65c3962a9 Mon Sep 17 00:00:00 2001 From: Oleksandr Zhurbenko Date: Tue, 8 Aug 2017 13:55:38 -0700 Subject: [PATCH] Made whiteboard-toolbar display when multi-user mode is on --- .../ui/components/presentation/component.jsx | 4 +-- .../ui/components/presentation/container.jsx | 26 +++++++++---------- .../ui/components/presentation/service.js | 13 +++++++++- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx index 44f6772a0d..e41ed8cfed 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx @@ -215,7 +215,7 @@ export default class PresentationArea extends React.Component { slideHeight={svgHeight} /> - {this.props.userIsPresenter ? + {this.props.userIsPresenter || this.props.multiUser ? diff --git a/bigbluebutton-html5/imports/ui/components/presentation/container.jsx b/bigbluebutton-html5/imports/ui/components/presentation/container.jsx index ab166e65f1..ed5be9614c 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/container.jsx @@ -1,24 +1,22 @@ -import React, { Component } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; import { createContainer } from 'meteor/react-meteor-data'; import PresentationAreaService from './service'; import PresentationArea from './component'; -class PresentationAreaContainer extends Component { - constructor(props) { - super(props); - } - - render() { - return ( - - {this.props.children} - - ); - } -} +const PresentationAreaContainer = ({ children, ...rest }) => ( + + {children} + + ); export default createContainer(() => ({ currentSlide: PresentationAreaService.getCurrentSlide(), userIsPresenter: PresentationAreaService.isPresenter(), + multiUser: PresentationAreaService.getMultiUserStatus(), }), PresentationAreaContainer); + + +PresentationAreaContainer.propTypes = { + children: PropTypes.element, +}; diff --git a/bigbluebutton-html5/imports/ui/components/presentation/service.js b/bigbluebutton-html5/imports/ui/components/presentation/service.js index 65bb555aec..067163f4f6 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/service.js +++ b/bigbluebutton-html5/imports/ui/components/presentation/service.js @@ -1,6 +1,6 @@ +import WhiteboardMultiUser from '/imports/api/2.0/whiteboard-multi-user/'; import Presentations from '/imports/api/2.0/presentations'; import Slides from '/imports/api/2.0/slides'; -import Cursor from '/imports/api/2.0/cursor'; import Users from '/imports/api/2.0/users'; import Auth from '/imports/ui/services/auth'; @@ -31,8 +31,19 @@ const isPresenter = () => { return false; }; +const getMultiUserStatus = () => { + const data = WhiteboardMultiUser.findOne({ meetingId: Auth.meetingID }); + + if (data) { + return data.multiUser; + } + + return false; +}; + export default { getCurrentPresentation, getCurrentSlide, isPresenter, + getMultiUserStatus, };