Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(whiteboard) adjust whiteboard ready check to work without config (#14486)

Mihaela Dumitruc7e80b678089
diff --git a/react/features/large-video/components/LargeVideo.web.tsx b/react/features/large-video/components/LargeVideo.web.tsx
index 10caefe387..1bd2e10fd2 100644
--- a/react/features/large-video/components/LargeVideo.web.tsx
+++ b/react/features/large-video/components/LargeVideo.web.tsx
@@ -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';
@@ -112,7 +112,7 @@ interface IProps {
/**
* Whether or not the whiteboard is ready to be used.
*/
- _whiteboardReady: boolean;
+ _whiteboardEnabled: boolean;
/**
* The Redux dispatch function.
@@ -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' : ''}`;
@@ -205,7 +205,7 @@ class LargeVideo extends Component<IProps> {
ref = { this._containerRef }
style = { style }>
<SharedVideo />
- {_whiteboardReady && <Whiteboard />}
+ {_whiteboardEnabled && <Whiteboard />}
<div id = 'etherpad' />
<Watermarks />
@@ -378,7 +378,7 @@ function _mapStateToProps(state: IReduxState) {
_verticalFilmstripWidth: verticalFilmstripWidth.current,
_verticalViewMaxWidth: getVerticalViewMaxWidth(state),
_visibleFilmstrip: visible,
- _whiteboardReady: isWhiteboardReady(state)
+ _whiteboardEnabled: isWhiteboardEnabled(state)
};
}
diff --git a/react/features/whiteboard/functions.ts b/react/features/whiteboard/functions.ts
index 4718c869b5..a04fbbd13b 100644
--- a/react/features/whiteboard/functions.ts
+++ b/react/features/whiteboard/functions.ts
@@ -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.