Skip to content

Commit 94ea6fe

Browse files
committed
fix bugs
1 parent ae6cd6d commit 94ea6fe

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

src/CallProvider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export const CallProvider = (props: { children: JSX.Element }) => {
255255
};
256256

257257
useSocketListener('voice:signal_received', (data: SignalPayload) => {
258+
if (!joinedChannelId) return;
258259
const key = peerKey(data.channelId, data.fromUserId);
259260
const existingPeer = peersRef.current.get(key);
260261

src/components/CallUI.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const CallUI = () => {
4040
call.endCall();
4141
};
4242

43-
return currentChannelId() ? (
43+
return call.joinedChannelId ? (
4444
<View style={style.container}>
4545
<View style={style.voiceItems}>
4646
{channelVoiceUsers().map(voice => (
@@ -51,18 +51,11 @@ export const CallUI = () => {
5151
/>
5252
))}
5353
</View>
54-
{/* {call.joinedChannelId !== currentChannelId() ? (
55-
<Button title="Call" onPress={handleCall} />
56-
) : (
57-
<Button title="End Call" onPress={handleEndCall} />
58-
)} */}
59-
60-
{call.joinedChannelId ? (
61-
<View style={style.controls}>
62-
<Button title="End Call" onPress={handleEndCall} color="red" />
63-
<Button title="Toggle Speaker" onPress={call.toggleSpeaker} />
64-
</View>
65-
) : null}
54+
55+
<View style={style.controls}>
56+
<Button title="End Call" onPress={handleEndCall} color="red" />
57+
<Button title="Toggle Speaker" onPress={call.toggleSpeaker} />
58+
</View>
6659
</View>
6760
) : null;
6861
};

0 commit comments

Comments
 (0)