move variable definition

This commit is contained in:
KDSBrowne 2022-08-03 14:30:22 +00:00
parent 7ade8a0d7d
commit 48cc57dbaf

View File

@ -205,6 +205,8 @@ export default function Whiteboard(props) {
}
}, [curPageId, slidePosition]);
const hasWBAccess = props?.hasMultiUserAccess(props.whiteboardId, props.currentUser.userId);
React.useEffect(() => {
if (hasWBAccess || isPresenter) {
const tdTools = document.getElementById("TD-Tools");
@ -238,8 +240,6 @@ export default function Whiteboard(props) {
}
});
const hasWBAccess = props?.hasMultiUserAccess(props.whiteboardId, props.currentUser.userId);
const onMount = (app) => {
setTLDrawAPI(app);
props.setTldrawAPI(app);
@ -329,7 +329,6 @@ export default function Whiteboard(props) {
showZoom={false}
showUI={curPres ? (isPresenter || hasWBAccess) : true}
showMenu={curPres ? false : true}
showMultiplayerMenu={false}
readOnly={false}
onPatch={onPatch}