diff --git a/.changeset/fix-call-camera-default.md b/.changeset/fix-call-camera-default.md new file mode 100644 index 00000000..a1a93ccd --- /dev/null +++ b/.changeset/fix-call-camera-default.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix camera turning on by default when starting a call from the room header button diff --git a/src/app/features/room/RoomCallButton.tsx b/src/app/features/room/RoomCallButton.tsx index 379842eb..ad3c7916 100644 --- a/src/app/features/room/RoomCallButton.tsx +++ b/src/app/features/room/RoomCallButton.tsx @@ -4,6 +4,7 @@ import { Room } from '$types/matrix-sdk'; import { useCallStart, useCallJoined } from '$hooks/useCallEmbed'; import { callEmbedAtom } from '$state/callEmbed'; import { useMatrixClient } from '$hooks/useMatrixClient'; +import { useCallPreferences } from '$state/hooks/callPreferences'; interface RoomCallButtonProps { room: Room; @@ -14,13 +15,14 @@ export function RoomCallButton({ room }: RoomCallButtonProps) { const callEmbed = useAtomValue(callEmbedAtom); const joined = useCallJoined(callEmbed); const mx = useMatrixClient(); + const { microphone, video, sound } = useCallPreferences(); const isJoinedInThisRoom = joined && callEmbed?.roomId === room.roomId; if (isJoinedInThisRoom) return null; const handleStartCall = async () => { - startCall(room); + startCall(room, { microphone, video, sound }); try { const now = Date.now(); // TODO not use as any one day someday i swear