|
@@ -84,9 +84,10 @@ MiddlewareRegistry.register(store => next => action => {
|
84
|
84
|
|
85
|
85
|
const { id, role } = action.participant;
|
86
|
86
|
const state = store.getState();
|
87
|
|
- const { role: oldRole } = getParticipantById(state, id);
|
|
87
|
+ const oldParticipant = getParticipantById(state, id);
|
|
88
|
+ const oldRole = oldParticipant?.role;
|
88
|
89
|
|
89
|
|
- if (oldRole !== role && role === PARTICIPANT_ROLE.MODERATOR) {
|
|
90
|
+ if (oldRole && oldRole !== role && role === PARTICIPANT_ROLE.MODERATOR) {
|
90
|
91
|
const displayName = getParticipantDisplayName(state, id);
|
91
|
92
|
|
92
|
93
|
store.dispatch(showNotification({
|