Merge pull request #305 from SableClient/fix/call-camera-default

fix(call): respect saved camera/mic preferences when starting call from room header
This commit is contained in:
Evie Gauthier authored and GitHub committed 2026-03-16 19:43:03 +00:00
commit bfefbf3c75
2 files changed
+8 -1

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
default: patch
---
Fix camera turning on by default when starting a call from the room header button
+3 -1
View File
@@ -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