381c5cb15c
Modified the previous implementation of the whiteboard individual access to remove multiple Collections dependency on this feature. Multi-user whiteboard is now an array instead of a boolean value and most of the access control can be synchronized and handled by akka-apps.
27 lines
906 B
JavaScript
27 lines
906 B
JavaScript
import React from 'react';
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
import TextShapeService from './service';
|
|
import TextDrawComponent from './component';
|
|
import WhiteboardService from '/imports/ui/components/whiteboard/service';
|
|
|
|
const TextDrawContainer = props => (
|
|
<TextDrawComponent {...props} />
|
|
);
|
|
|
|
export default withTracker((params) => {
|
|
const { whiteboardId } = params;
|
|
const isPresenter = TextShapeService.isPresenter();
|
|
const isMultiUser = WhiteboardService.isMultiUserActive(whiteboardId);
|
|
const activeTextShapeId = TextShapeService.activeTextShapeId();
|
|
let isActive = false;
|
|
|
|
if ((isPresenter || isMultiUser) && activeTextShapeId === params.annotation.id) {
|
|
isActive = true;
|
|
}
|
|
return {
|
|
isActive,
|
|
setTextShapeValue: TextShapeService.setTextShapeValue,
|
|
resetTextShapeActiveId: TextShapeService.resetTextShapeActiveId,
|
|
};
|
|
})(TextDrawContainer);
|