|
|
@@ -9,12 +9,13 @@ import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
|
|
9
|
9
|
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
|
|
10
|
10
|
import { getCurrentRoomId } from '../breakout-rooms/functions';
|
|
11
|
11
|
import { addStageParticipant } from '../filmstrip/actions.web';
|
|
12
|
|
-import { isStageFilmstripAvailable } from '../filmstrip/functions';
|
|
|
12
|
+import { isStageFilmstripAvailable } from '../filmstrip/functions.web';
|
|
13
|
13
|
|
|
14
|
14
|
import { RESET_WHITEBOARD, SET_WHITEBOARD_OPEN } from './actionTypes';
|
|
15
|
15
|
import { resetWhiteboard, setWhiteboardOpen, setupWhiteboard } from './actions';
|
|
16
|
16
|
import { WHITEBOARD_ID, WHITEBOARD_PARTICIPANT_NAME } from './constants';
|
|
17
|
17
|
import { getCollabDetails, getCollabServerUrl, isWhiteboardPresent } from './functions';
|
|
|
18
|
+import { WhiteboardStatus } from './types';
|
|
18
|
19
|
|
|
19
|
20
|
const focusWhiteboard = (store: IStore) => {
|
|
20
|
21
|
const { dispatch, getState } = store;
|
|
|
@@ -68,21 +69,27 @@ MiddlewareRegistry.register((store: IStore) => (next: Function) => async (action
|
|
68
|
69
|
collabServerUrl,
|
|
69
|
70
|
collabDetails
|
|
70
|
71
|
});
|
|
|
72
|
+ raiseWhiteboardNotification(WhiteboardStatus.INSTANTIATED);
|
|
71
|
73
|
|
|
72
|
74
|
return;
|
|
73
|
75
|
}
|
|
74
|
76
|
|
|
75
|
77
|
if (action.isOpen) {
|
|
76
|
78
|
focusWhiteboard(store);
|
|
|
79
|
+ raiseWhiteboardNotification(WhiteboardStatus.SHOWN);
|
|
77
|
80
|
|
|
78
|
81
|
return;
|
|
79
|
82
|
}
|
|
80
|
83
|
|
|
81
|
84
|
dispatch(participantLeft(WHITEBOARD_ID, conference, { fakeParticipant: FakeParticipant.Whiteboard }));
|
|
|
85
|
+ raiseWhiteboardNotification(WhiteboardStatus.HIDDEN);
|
|
|
86
|
+
|
|
82
|
87
|
break;
|
|
83
|
88
|
}
|
|
84
|
89
|
case RESET_WHITEBOARD: {
|
|
85
|
90
|
dispatch(participantLeft(WHITEBOARD_ID, conference, { fakeParticipant: FakeParticipant.Whiteboard }));
|
|
|
91
|
+ raiseWhiteboardNotification(WhiteboardStatus.RESET);
|
|
|
92
|
+
|
|
86
|
93
|
break;
|
|
87
|
94
|
}
|
|
88
|
95
|
}
|
|
|
@@ -90,6 +97,18 @@ MiddlewareRegistry.register((store: IStore) => (next: Function) => async (action
|
|
90
|
97
|
return next(action);
|
|
91
|
98
|
});
|
|
92
|
99
|
|
|
|
100
|
+/**
|
|
|
101
|
+ * Raises the whiteboard status notifications changes (if API is enabled).
|
|
|
102
|
+ *
|
|
|
103
|
+ * @param {WhiteboardStatus} status - The whiteboard changed status.
|
|
|
104
|
+ * @returns {Function}
|
|
|
105
|
+ */
|
|
|
106
|
+function raiseWhiteboardNotification(status: WhiteboardStatus) {
|
|
|
107
|
+ if (typeof APP !== 'undefined') {
|
|
|
108
|
+ APP.API.notifyWhiteboardStatusChanged(status);
|
|
|
109
|
+ }
|
|
|
110
|
+}
|
|
|
111
|
+
|
|
93
|
112
|
/**
|
|
94
|
113
|
* Set up state change listener to perform maintenance tasks when the conference
|
|
95
|
114
|
* is left or failed, e.g. Disable the whiteboard if it's left open.
|