|
@@ -29,15 +29,12 @@ export function dominantSpeakerChanged(id) {
|
29
|
29
|
}
|
30
|
30
|
|
31
|
31
|
/**
|
32
|
|
- * Action to signal that ID of local participant has changed. This happens when
|
33
|
|
- * local participant joins a new conference or quits one.
|
|
32
|
+ * Action to signal that the ID of local participant has changed. It happens
|
|
33
|
+ * when the local participant joins a new conference or leaves an existing
|
|
34
|
+ * conference.
|
34
|
35
|
*
|
35
|
36
|
* @param {string} id - New ID for local participant.
|
36
|
|
- * @returns {{
|
37
|
|
- * type: PARTICIPANT_ID_CHANGED,
|
38
|
|
- * newValue: string,
|
39
|
|
- * oldValue: string
|
40
|
|
- * }}
|
|
37
|
+ * @returns {Function}
|
41
|
38
|
*/
|
42
|
39
|
export function localParticipantIdChanged(id) {
|
43
|
40
|
return (dispatch, getState) => {
|
|
@@ -69,6 +66,24 @@ export function localParticipantJoined(participant = {}) {
|
69
|
66
|
});
|
70
|
67
|
}
|
71
|
68
|
|
|
69
|
+/**
|
|
70
|
+ * Action to signal the role of the local participant has changed. It can happen
|
|
71
|
+ * when the participant has joined a conference, even before a non-default local
|
|
72
|
+ * id has been set, or after a moderator leaves.
|
|
73
|
+ *
|
|
74
|
+ * @param {string} role - The new role of the local participant.
|
|
75
|
+ * @returns {Function}
|
|
76
|
+ */
|
|
77
|
+export function localParticipantRoleChanged(role) {
|
|
78
|
+ return (dispatch, getState) => {
|
|
79
|
+ const participant = getLocalParticipant(getState);
|
|
80
|
+
|
|
81
|
+ if (participant) {
|
|
82
|
+ return dispatch(participantRoleChanged(participant.id, role));
|
|
83
|
+ }
|
|
84
|
+ };
|
|
85
|
+}
|
|
86
|
+
|
72
|
87
|
/**
|
73
|
88
|
* Action to update a participant's connection status.
|
74
|
89
|
*
|