prevent call join if call not supported and started by other party

This commit is contained in:
Ajay Bura
2026-05-13 09:24:15 +05:30
parent 4cdace0ffc
commit 697d0a4e2f
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -18,7 +18,7 @@ import { useLivekitSupport } from '../../hooks/useLivekitSupport';
function LivekitServerMissingMessage() { function LivekitServerMissingMessage() {
return ( return (
<Text style={{ margin: 'auto', color: color.Critical.Main }} size="L400" align="Center"> <Text style={{ margin: 'auto', color: color.Critical.Main }} size="L400" align="Center">
Your homeserver does not support calling. But you can still join call started by others. Your homeserver does not support calling.
</Text> </Text>
); );
} }
@@ -30,12 +30,12 @@ function JoinMessage({
hasParticipant?: boolean; hasParticipant?: boolean;
livekitSupported?: boolean; livekitSupported?: boolean;
}) { }) {
if (hasParticipant) return null;
if (livekitSupported === false) { if (livekitSupported === false) {
return <LivekitServerMissingMessage />; return <LivekitServerMissingMessage />;
} }
if (hasParticipant) return null;
return ( return (
<Text style={{ margin: 'auto' }} size="L400" align="Center"> <Text style={{ margin: 'auto' }} size="L400" align="Center">
Voice chats empty Be the first to hop in! Voice chats empty Be the first to hop in!
@@ -80,7 +80,7 @@ function CallPrescreen() {
const callEmbed = useCallEmbed(); const callEmbed = useCallEmbed();
const inOtherCall = callEmbed && callEmbed.roomId !== room.roomId; const inOtherCall = callEmbed && callEmbed.roomId !== room.roomId;
const canJoin = hasPermission && (livekitSupported || hasParticipant); const canJoin = hasPermission && livekitSupported;
return ( return (
<Scroll variant="Surface" hideTrack> <Scroll variant="Surface" hideTrack>
+2 -2
View File
@@ -298,8 +298,8 @@ export function RoomNavItem({
mx.getSafeUserId() mx.getSafeUserId()
); );
// Do not join if missing permissions or no livekit support and call is not started by others // Do not join if missing permissions or no livekit support
if (!hasCallPermission || (!livekitSupport(autoDiscoveryInfo) && callMembers.length === 0)) { if (!hasCallPermission || !livekitSupport(autoDiscoveryInfo)) {
return; return;
} }