Merge pull request #17792 from Scroody/I-17741

fix: Default cursor not appearing when entering meeting.
This commit is contained in:
Anton Georgiev 2023-05-04 10:38:31 -04:00 committed by GitHub
commit 5f0686697a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,7 +221,7 @@ const Cursors = (props) => {
React.useEffect(() => { React.useEffect(() => {
const currentCursor = cursorWrapper?.current; const currentCursor = cursorWrapper?.current;
currentCursor?.addEventListener('mouseenter', start); currentCursor?.addEventListener('mouseenter', start);
currentCursor?.addEventListener('touchstart', start); currentCursor?.addEventListener('touchstart', start);
currentCursor?.addEventListener('mouseleave', end); currentCursor?.addEventListener('mouseleave', end);
currentCursor?.addEventListener('mousedown', handleGrabbing); currentCursor?.addEventListener('mousedown', handleGrabbing);
currentCursor?.addEventListener('mouseup', handleReleaseGrab); currentCursor?.addEventListener('mouseup', handleReleaseGrab);
@ -231,7 +231,7 @@ const Cursors = (props) => {
return () => { return () => {
currentCursor?.removeEventListener('mouseenter', start); currentCursor?.removeEventListener('mouseenter', start);
currentCursor?.addEventListener('touchstart', start); currentCursor?.addEventListener('touchstart', start);
currentCursor?.removeEventListener('mouseleave', end); currentCursor?.removeEventListener('mouseleave', end);
currentCursor?.removeEventListener('mousedown', handleGrabbing); currentCursor?.removeEventListener('mousedown', handleGrabbing);
currentCursor?.removeEventListener('mouseup', handleReleaseGrab); currentCursor?.removeEventListener('mouseup', handleReleaseGrab);
@ -241,7 +241,8 @@ const Cursors = (props) => {
}; };
}, [cursorWrapper, whiteboardId, currentUser.presenter, whiteboardToolbarAutoHide]); }, [cursorWrapper, whiteboardId, currentUser.presenter, whiteboardToolbarAutoHide]);
let cursorType = multiUserAccess || currentUser?.presenter ? TOOL_CURSORS[currentTool] || 'none' : 'default'; let cursorType = multiUserAccess || currentUser?.presenter ? TOOL_CURSORS[currentTool] : 'default';
if (isPanning) { if (isPanning) {
if (panGrabbing) { if (panGrabbing) {
cursorType = TOOL_CURSORS.grabbing; cursorType = TOOL_CURSORS.grabbing;
@ -250,7 +251,6 @@ const Cursors = (props) => {
} }
} }
if (isMoving) cursorType = TOOL_CURSORS.moving; if (isMoving) cursorType = TOOL_CURSORS.moving;
return ( return (
<span key={`cursor-wrapper-${whiteboardId}`} ref={cursorWrapper}> <span key={`cursor-wrapper-${whiteboardId}`} ref={cursorWrapper}>
<div style={{ height: '100%', cursor: cursorType }}> <div style={{ height: '100%', cursor: cursorType }}>