Skip to content

Commit

Permalink
* don't show notification to recorder
Browse files Browse the repository at this point in the history
* fixed: waiting user notification wasn't showing
  • Loading branch information
jibon57 committed Aug 14, 2022
1 parent 1852d54 commit 7a5ee3b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
41 changes: 23 additions & 18 deletions src/helpers/livekit/HandleParticipants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,8 @@ export default class HandleParticipants {
) => {
let metadata;
if (participant.metadata) {
const m: ICurrentUserMetadata = JSON.parse(participant.metadata);
if (
m.wait_for_approval &&
store.getState().session.currentUser?.metadata?.is_admin
) {
toast(
i18n
.t('waiting-room.user-waiting', {
name: participant.name,
})
.toString(),
{
type: 'info',
toastId: 'user-waiting',
},
);
}
metadata = m;
metadata = JSON.parse(participant.metadata);
this.notificationForWaitingUser(metadata, participant.name);
}

store.dispatch(
Expand Down Expand Up @@ -177,6 +161,8 @@ export default class HandleParticipants {
) => {
if (participant.metadata) {
const metadata: ICurrentUserMetadata = JSON.parse(participant.metadata);
this.notificationForWaitingUser(metadata, participant.name);

store.dispatch(
updateParticipant({
id: participant.identity,
Expand All @@ -192,4 +178,23 @@ export default class HandleParticipants {
}
}
};

private notificationForWaitingUser(metadata: ICurrentUserMetadata, name) {
if (
metadata.wait_for_approval &&
store.getState().session.currentUser?.metadata?.is_admin
) {
toast(
i18n
.t('waiting-room.user-waiting', {
name: name,
})
.toString(),
{
type: 'info',
toastId: 'user-waiting',
},
);
}
}
}
4 changes: 4 additions & 0 deletions src/helpers/websocket/handleSystemType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ const handleExternalMediaPlayerEvents = (data: DataMessage) => {
};

const handlePollsNotifications = (data: DataMessage) => {
// for recorder don't need to show anything
if (store.getState().session.currentUser?.isRecorder) {
return;
}
if (data.body?.type === DataMsgBodyType.POLL_CREATED) {
toast(<NewPollMsg />, {
toastId: 'info-status',
Expand Down

0 comments on commit 7a5ee3b

Please sign in to comment.