Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tauri/src/components/ui/call-center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ export function ConnectedActions() {
const callParticipant = teammates?.find((user) => user.id === callTokens?.participant);
const [controllerCursorState, setControllerCursorState] = useState(true);
const [accessibilityPermission, setAccessibilityPermission] = useState(true);
const remoteParticipants = useRemoteParticipants();

// Find the remote audio participant and check if they have microphone enabled
const remoteAudioParticipant = remoteParticipants.find(
(p) => p.identity.includes("audio") && callParticipant && p.identity.includes(callParticipant.id),
);
const isRemoteMuted = remoteAudioParticipant ? !remoteAudioParticipant.isMicrophoneEnabled : false;

useScreenShareListener();
const handleEndCall = useEndCall();
Expand Down Expand Up @@ -137,6 +144,7 @@ export function ConnectedActions() {
src={callParticipant?.avatar_url || undefined}
firstName={callParticipant?.first_name}
lastName={callParticipant?.last_name}
isMuted={isRemoteMuted}
/>
)}
</div>
Expand Down
10 changes: 9 additions & 1 deletion tauri/src/components/ui/hopp-avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Avatar, AvatarFallback, AvatarImage } from "@radix-ui/react-avatar";
import { clsx } from "clsx";
import { LuMicOff } from "react-icons/lu";

type Status = "online" | "offline";

Expand All @@ -9,9 +10,10 @@ interface HoppAvatarProps {
lastName: string;
status?: Status;
className?: string;
isMuted?: boolean;
}

export const HoppAvatar = ({ src, firstName, lastName, status, className }: HoppAvatarProps) => {
export const HoppAvatar = ({ src, firstName, lastName, status, className, isMuted }: HoppAvatarProps) => {
return (
<div className="relative">
<Avatar
Expand All @@ -26,6 +28,12 @@ export const HoppAvatar = ({ src, firstName, lastName, status, className }: Hopp
{lastName[0]}
</AvatarFallback>
</Avatar>
{/* Absolute gray blanket for muted indicator */}
{isMuted && (
<div className="absolute flex items-center justify-center inset-0 bg-gray-500/40 rounded-md w-full h-full">
{isMuted && <LuMicOff className="size-4 text-white" />}
</div>
)}
{status && (
<div
className={clsx("absolute bottom-0 right-0 size-2 outline-solid outline-3 outline-white rounded-full", {
Expand Down
8 changes: 8 additions & 0 deletions tauri/src/windows/main-window/tabs/Rooms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { Button } from "@/components/ui/button";
import { HiMiniLink, HiMiniUser } from "react-icons/hi2";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
import { HiMagnifyingGlass, HiOutlinePencil, HiOutlineTrash } from "react-icons/hi2";
import { LuMicOff } from "react-icons/lu";
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
import { Constants } from "@/constants";
import { useState } from "react";
Expand Down Expand Up @@ -553,6 +554,7 @@ const SelectedRoom = ({ room }: { room: Room }) => {
participantId,
user: foundUser,
isLocal: participant.isLocal,
isMicrophoneEnabled: participant.isMicrophoneEnabled,
};
});
}, [participants, teammates, user]);
Expand Down Expand Up @@ -597,6 +599,12 @@ const SelectedRoom = ({ room }: { room: Room }) => {
{participant.user.first_name} {participant.user.last_name}
{participant.isLocal && " (You)"}
</span>
{!participant.isMicrophoneEnabled && (
<span className="flex items-center gap-1 text-xs font-medium text-orange-500">
<LuMicOff className="size-3" />
<span className="mt-0.5">Muted</span>
</span>
)}
</div>
</>
: <>
Expand Down
Loading