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