Skip to content

Commit bd2cd4e

Browse files
Address PR comments
1 parent 7124285 commit bd2cd4e

5 files changed

Lines changed: 21 additions & 21 deletions

File tree

react-demo-app/src/components/ActiveConversationsTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default function ActiveConversationsTable() {
1717

1818
useEffect(() => {
1919
if (conversations.length) {
20-
setHoldLabels(conversations.map((convo) => convo?.mostRecentCallState!.held ? 'Unhold' : 'Hold'));
21-
setMuteLabels(conversations.map((convo) => convo.mostRecentCallState!.muted ? 'Unmute' : 'Mute'));
20+
setHoldLabels(conversations.map((convo) => convo.mostRecentCallState?.held ? 'Unhold' : 'Hold'));
21+
setMuteLabels(conversations.map((convo) => convo.mostRecentCallState?.muted ? 'Unmute' : 'Mute'));
2222
}
2323
}, [conversations]);
2424

react-demo-app/src/components/Video/ActiveVideoConversationsTable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function ActiveVideoConversationsTable() {
5555
dispatch(setCurrentlyDisplayedConversation({ conversationId }));
5656
};
5757

58-
const isLocalPartSharingScreen: boolean[] =
58+
const isLocalParticipantScreensharing: boolean[] =
5959
videoConversations.map(vc => {
6060
const localPart = vc.participantsUpdate?.activeParticipants
6161
?.find(p => p.userId === getSession(vc.conversationId).fromUserId);
@@ -64,7 +64,7 @@ export default function ActiveVideoConversationsTable() {
6464

6565
function handleScreenShare(index: number) {
6666
const session = getSession(videoConversations[index].conversationId);
67-
if (isLocalPartSharingScreen[index]) {
67+
if (isLocalParticipantScreensharing[index]) {
6868
stopScreenShare(session);
6969
} else {
7070
startScreenShare(session);
@@ -95,7 +95,7 @@ export default function ActiveVideoConversationsTable() {
9595
const screenShareButton = (index: number) => {
9696
return (
9797
<GuxButton onClick={() => handleScreenShare(index)}>
98-
{isLocalPartSharingScreen[index] ? 'Stop' : 'Start'}
98+
{isLocalParticipantScreensharing[index] ? 'Stop' : 'Start'}
9999
</GuxButton>
100100
);
101101
}
@@ -112,7 +112,7 @@ export default function ActiveVideoConversationsTable() {
112112

113113
const videoMuteButton = (index: number) => {
114114
return (
115-
<GuxButton onClick={() => handleVideoMuteToggle(index)} disabled={isLocalPartSharingScreen[index]}>
115+
<GuxButton onClick={() => handleVideoMuteToggle(index)} disabled={isLocalParticipantScreensharing[index]}>
116116
{videoConversations?.[index].loadingVideo ?
117117
<GuxRadialLoading context='input' screenreaderText='Loading...'></GuxRadialLoading> :
118118
getParticipantUsingDemoApp(index)?.videoMuted ? 'Unmute' : 'Mute'}

react-demo-app/src/components/Video/Video.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ export default function Video() {
4747
type="submit"
4848
onClick={() => startConv(startVideoConference)}
4949
>
50-
Join with roomJid
50+
Join with Room JID
5151
</GuxButton>
5252
<GuxButton
5353
accent="primary"
5454
className="video-call-btn"
5555
onClick={() => startConv(startVideoMeeting)}
5656
>
57-
Join with conferenceId
57+
Join with Conference ID
5858
</GuxButton>
5959
</div>
6060
</Card>

react-demo-app/src/components/Video/VideoElements.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import VideoElement from "./VideoElement.tsx";
1010
import useSdk from "../../hooks/useSdk.ts";
1111

1212
export default function VideoElements({
13-
audioRef,
14-
videoRef,
15-
vanityVideoRef,
16-
}: {
13+
audioRef,
14+
videoRef,
15+
vanityVideoRef,
16+
}: {
1717
audioRef: RefObject<HTMLAudioElement>,
1818
videoRef: RefObject<HTMLVideoElement>,
1919
vanityVideoRef: RefObject<HTMLVideoElement>,

react-demo-app/src/features/videoConversationsSlice.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const toggleAudioMute = createAsyncThunk(
4646
}
4747
);
4848

49-
function findConvInState(state: Draft<IVideoConversationsState>, convId: string) {
49+
function findConversationInState(state: Draft<IVideoConversationsState>, convId: string) {
5050
const conversations = state.activeVideoConversations;
5151
const conversation = conversations.find((conv) => conv.conversationId === convId);
5252
return conversation;
@@ -62,7 +62,7 @@ export const videoConversationsSlice = createSlice({
6262
state.currentlyDisplayedConversationId = action.payload.conversationId;
6363
},
6464
addParticipantUpdateToVideoConversation: (state, action) => {
65-
const conv = findConvInState(state, action.payload.conversationId);
65+
const conv = findConversationInState(state, action.payload.conversationId);
6666
if (conv) {
6767
conv.participantsUpdate = action.payload;
6868
}
@@ -84,7 +84,7 @@ export const videoConversationsSlice = createSlice({
8484
state.currentlyDisplayedConversationId = action.payload.conversationId;
8585
},
8686
updateConversationMediaStreams: (state, action) => {
87-
const conv = findConvInState(state, action.payload.conversationId);
87+
const conv = findConversationInState(state, action.payload.conversationId);
8888
if (conv) {
8989
if (action.payload.inboundStream !== undefined) {
9090
conv.inboundStream = action.payload.inboundStream;
@@ -98,13 +98,13 @@ export const videoConversationsSlice = createSlice({
9898
}
9999
},
100100
setActiveParticipants: (state, action) => {
101-
const conv = findConvInState(state, action.payload.conversationId);
101+
const conv = findConversationInState(state, action.payload.conversationId);
102102
if (conv) {
103103
conv.activeParticipant = action.payload.activeParticipant;
104104
}
105105
},
106106
setUsersTalking: (state, action) => {
107-
const conv = findConvInState(state, action.payload.conversationId);
107+
const conv = findConversationInState(state, action.payload.conversationId);
108108
if (conv) {
109109
conv.usersTalking = action.payload.usersTalking;
110110
}
@@ -113,13 +113,13 @@ export const videoConversationsSlice = createSlice({
113113
extraReducers: (builder) => {
114114
builder
115115
.addCase(toggleVideoMute.pending, (state, action) => {
116-
const conv = findConvInState(state, action.meta.arg.conversationId);
116+
const conv = findConversationInState(state, action.meta.arg.conversationId);
117117
if (conv) {
118118
conv.loadingVideo = true;
119119
}
120120
})
121121
.addCase(toggleVideoMute.fulfilled, (state, action) => {
122-
const conv = findConvInState(state, action.meta.arg.conversationId);
122+
const conv = findConversationInState(state, action.meta.arg.conversationId);
123123
if (conv) {
124124
conv.loadingVideo = false;
125125
const participant = conv.participantsUpdate?.activeParticipants.find(p => p.userId === action.meta.arg.userId);
@@ -129,13 +129,13 @@ export const videoConversationsSlice = createSlice({
129129
}
130130
})
131131
.addCase(toggleAudioMute.pending, (state, action) => {
132-
const conv = findConvInState(state, action.meta.arg.conversationId);
132+
const conv = findConversationInState(state, action.meta.arg.conversationId);
133133
if (conv) {
134134
conv.loadingAudio = true;
135135
}
136136
})
137137
.addCase(toggleAudioMute.fulfilled, (state, action) => {
138-
const conv = findConvInState(state, action.meta.arg.conversationId);
138+
const conv = findConversationInState(state, action.meta.arg.conversationId);
139139
if (conv) {
140140
conv.loadingAudio = false;
141141
const participant = conv.participantsUpdate?.activeParticipants.find(p => p.userId === action.meta.arg.userId);

0 commit comments

Comments
 (0)