Skip to content

Commit bfefbf3

Browse files
authored
Merge pull request #305 from SableClient/fix/call-camera-default
fix(call): respect saved camera/mic preferences when starting call from room header
2 parents 7257255 + cd1f7ef commit bfefbf3

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: patch
3+
---
4+
5+
Fix camera turning on by default when starting a call from the room header button

src/app/features/room/RoomCallButton.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Room } from '$types/matrix-sdk';
44
import { useCallStart, useCallJoined } from '$hooks/useCallEmbed';
55
import { callEmbedAtom } from '$state/callEmbed';
66
import { useMatrixClient } from '$hooks/useMatrixClient';
7+
import { useCallPreferences } from '$state/hooks/callPreferences';
78

89
interface RoomCallButtonProps {
910
room: Room;
@@ -14,13 +15,14 @@ export function RoomCallButton({ room }: RoomCallButtonProps) {
1415
const callEmbed = useAtomValue(callEmbedAtom);
1516
const joined = useCallJoined(callEmbed);
1617
const mx = useMatrixClient();
18+
const { microphone, video, sound } = useCallPreferences();
1719

1820
const isJoinedInThisRoom = joined && callEmbed?.roomId === room.roomId;
1921

2022
if (isJoinedInThisRoom) return null;
2123

2224
const handleStartCall = async () => {
23-
startCall(room);
25+
startCall(room, { microphone, video, sound });
2426
try {
2527
const now = Date.now();
2628
// TODO not use as any one day someday i swear

0 commit comments

Comments
 (0)