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): prevent reopening closed whiteboard on unrelated metadata updates

Marco Scammaccad31c119e4c9b
diff --git a/react/features/whiteboard/middleware.any.ts b/react/features/whiteboard/middleware.any.ts
index 3d7a92a7cc..aa5f23d347 100644
--- a/react/features/whiteboard/middleware.any.ts
+++ b/react/features/whiteboard/middleware.any.ts
@@ -41,10 +41,15 @@ MiddlewareRegistry.register((store: IStore) => next => action => {
case UPDATE_CONFERENCE_METADATA: {
const { metadata } = action;
+ const newCollabDetails = metadata?.[WHITEBOARD_ID]?.collabDetails;
- if (metadata?.[WHITEBOARD_ID]) {
+ // Only react when a *new* whiteboard collaboration session is announced. Otherwise unrelated
+ // metadata updates (e.g. toggling the lobby) would re-open a whiteboard the user had closed.
+ const previousCollabDetails = state['features/base/conference'].metadata?.[WHITEBOARD_ID]?.collabDetails;
+
+ if (newCollabDetails && newCollabDetails.roomId !== previousCollabDetails?.roomId) {
store.dispatch(setupWhiteboard({
- collabDetails: metadata[WHITEBOARD_ID].collabDetails,
+ collabDetails: newCollabDetails,
collabServerUrl: generateCollabServerUrl(store.getState())
}));