prevent call join if call not supported and started by other party
This commit is contained in:
@@ -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 chat’s empty — Be the first to hop in!
|
Voice chat’s 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>
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user