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
5 changes: 5 additions & 0 deletions .changeset/fix-call-camera-default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Fix camera turning on by default when starting a call from the room header button
4 changes: 3 additions & 1 deletion src/app/features/room/RoomCallButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
Loading