Skip to content

Commit

Permalink
fix(whiteboard) adjust whiteboard ready check to work without config (j…
Browse files Browse the repository at this point in the history
  • Loading branch information
mihhu authored Mar 18, 2024
1 parent ec5f2ca commit c7e80b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions react/features/large-video/components/LargeVideo.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SharedVideo from '../../shared-video/components/web/SharedVideo';
import Captions from '../../subtitles/components/web/Captions';
import { setTileView } from '../../video-layout/actions.web';
import Whiteboard from '../../whiteboard/components/web/Whiteboard';
import { isWhiteboardReady } from '../../whiteboard/functions';
import { isWhiteboardEnabled } from '../../whiteboard/functions';
import { setSeeWhatIsBeingShared } from '../actions.web';
import { getLargeVideoParticipant } from '../functions';

Expand Down Expand Up @@ -112,7 +112,7 @@ interface IProps {
/**
* Whether or not the whiteboard is ready to be used.
*/
_whiteboardReady: boolean;
_whiteboardEnabled: boolean;

/**
* The Redux dispatch function.
Expand Down Expand Up @@ -193,7 +193,7 @@ class LargeVideo extends Component<IProps> {
_isChatOpen,
_noAutoPlayVideo,
_showDominantSpeakerBadge,
_whiteboardReady
_whiteboardEnabled
} = this.props;
const style = this._getCustomStyles();
const className = `videocontainer${_isChatOpen ? ' shift-right' : ''}`;
Expand All @@ -205,7 +205,7 @@ class LargeVideo extends Component<IProps> {
ref = { this._containerRef }
style = { style }>
<SharedVideo />
{_whiteboardReady && <Whiteboard />}
{_whiteboardEnabled && <Whiteboard />}
<div id = 'etherpad' />

<Watermarks />
Expand Down Expand Up @@ -378,7 +378,7 @@ function _mapStateToProps(state: IReduxState) {
_verticalFilmstripWidth: verticalFilmstripWidth.current,
_verticalViewMaxWidth: getVerticalViewMaxWidth(state),
_visibleFilmstrip: visible,
_whiteboardReady: isWhiteboardReady(state)
_whiteboardEnabled: isWhiteboardEnabled(state)
};
}

Expand Down
20 changes: 10 additions & 10 deletions react/features/whiteboard/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,26 @@ export const getCollabDetails = (state: IReduxState): {
} | undefined => getWhiteboardState(state).collabDetails;

/**
* Indicates whether the whiteboard is enabled in the config.
* Indicates whether the whiteboard collaboration details are available.
*
* @param {IReduxState} state - The state from the Redux store.
* @returns {boolean}
*/
export const isWhiteboardEnabled = (state: IReduxState): boolean =>
getWhiteboardConfig(state).enabled
&& getWhiteboardConfig(state).collabServerBaseUrl
&& getCurrentConference(state)?.getMetadataHandler()
?.isSupported();
const hasCollabDetails = (state: IReduxState): boolean => Boolean(
getCollabDetails(state)?.roomId && getCollabDetails(state)?.roomKey
);

/**
* Indicates whether the whiteboard has the collaboration
* details and is ready to be used.
* Indicates whether the whiteboard is enabled.
*
* @param {IReduxState} state - The state from the Redux store.
* @returns {boolean}
*/
export const isWhiteboardReady = (state: IReduxState): boolean =>
isWhiteboardEnabled(state) && Boolean(getCollabDetails(state));
export const isWhiteboardEnabled = (state: IReduxState): boolean =>
(getWhiteboardConfig(state).enabled || hasCollabDetails(state))
&& getWhiteboardConfig(state).collabServerBaseUrl
&& getCurrentConference(state)?.getMetadataHandler()
?.isSupported();

/**
* Indicates whether the whiteboard is open.
Expand Down

0 comments on commit c7e80b6

Please sign in to comment.