Skip to content

Commit

Permalink
update breakout room lists instantly after end
Browse files Browse the repository at this point in the history
  • Loading branch information
jibon57 committed Sep 16, 2024
1 parent a084a8a commit 0d1a153
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"microsoft-cognitiveservices-speech-sdk": "1.40.0",
"mobile-detect": "1.4.5",
"nosleep.js": "0.12.0",
"plugnmeet-protocol-js": "1.0.5-rc.14",
"plugnmeet-protocol-js": "1.0.5-rc.15",
"react": "18.3.1",
"react-cool-virtual": "0.7.0",
"react-dnd": "16.0.1",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/helpers/nats/ConnectNats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,8 @@ export default class ConnectNats {
this.handleSystemData.handlePoll(payload);
break;
case NatsMsgServerToClientEvents.JOIN_BREAKOUT_ROOM:
this.handleSystemData.handleBreakoutRoomNotifications(payload.msg);
case NatsMsgServerToClientEvents.BREAKOUT_ROOM_ENDED:
this.handleSystemData.handleBreakoutRoom(payload);
break;
case NatsMsgServerToClientEvents.SYSTEM_CHAT_MSG:
this.handleSystemData.handleSysChatMsg(payload.msg);
Expand Down
38 changes: 24 additions & 14 deletions src/helpers/nats/HandleSystemData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,34 @@ export default class HandleSystemData {
};

public handlePoll = (payload: NatsMsgServerToClient) => {
if (payload.event === NatsMsgServerToClientEvents.POLL_CREATED) {
toast(<NewPollMsg />, {
toastId: 'info-status',
type: 'info',
autoClose: false,
});
store.dispatch(pollsApi.util.invalidateTags(['List', 'PollsStats']));
} else if (payload.event === NatsMsgServerToClientEvents.POLL_CLOSED) {
store.dispatch(pollsApi.util.invalidateTags(['List', 'PollsStats']));
switch (payload.event) {
case NatsMsgServerToClientEvents.POLL_CREATED:
toast(<NewPollMsg />, {
toastId: 'info-status',
type: 'info',
autoClose: false,
});
store.dispatch(pollsApi.util.invalidateTags(['List', 'PollsStats']));
break;
case NatsMsgServerToClientEvents.POLL_CLOSED:
store.dispatch(pollsApi.util.invalidateTags(['List', 'PollsStats']));
break;
}
};

public handleBreakoutRoomNotifications = (msg: string) => {
if (msg === '') {
return;
public handleBreakoutRoom = (payload: NatsMsgServerToClient) => {
switch (payload.event) {
case NatsMsgServerToClientEvents.JOIN_BREAKOUT_ROOM:
if (payload.msg !== '') {
store.dispatch(updateReceivedInvitationFor(payload.msg));
store.dispatch(breakoutRoomApi.util.invalidateTags(['My_Rooms']));
}
break;
case NatsMsgServerToClientEvents.BREAKOUT_ROOM_ENDED:
store.dispatch(breakoutRoomApi.util.invalidateTags(['List']));
store.dispatch(breakoutRoomApi.util.invalidateTags(['My_Rooms']));
break;
}
store.dispatch(updateReceivedInvitationFor(msg));
store.dispatch(breakoutRoomApi.util.invalidateTags(['My_Rooms']));
};

public handleSysChatMsg = (msg: string) => {
Expand Down

0 comments on commit 0d1a153

Please sign in to comment.