From 1b97bb8780ab95f47531563221aecf981c6eec99 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 13 Mar 2026 14:16:09 -0500 Subject: [PATCH 1/2] fix call preferences not persisting --- src/app/features/call/CallControls.tsx | 21 ++++++++++++++------- src/app/state/hooks/callPreferences.ts | 2 ++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/app/features/call/CallControls.tsx b/src/app/features/call/CallControls.tsx index 4688ce8a7..6643069c5 100644 --- a/src/app/features/call/CallControls.tsx +++ b/src/app/features/call/CallControls.tsx @@ -1,4 +1,4 @@ -import { MouseEventHandler, useCallback, useRef, useState } from 'react'; +import { MouseEventHandler, useCallback, useEffect, useRef, useState } from 'react'; import { Box, Button, @@ -15,7 +15,13 @@ import { toRem, } from 'folds'; import FocusTrap from 'focus-trap-react'; -import { SequenceCard } from '../../components/sequence-card'; +import { SequenceCard } from '$components/sequence-card'; +import { CallEmbed, useCallControlState } from '$plugins/call'; +import { stopPropagation } from '$utils/keyboard'; +import { AsyncStatus, useAsyncCallback } from '$hooks/useAsyncCallback'; +import { useRoom } from '$hooks/useRoom'; +import { ScreenSize, useScreenSizeContext } from '$hooks/useScreenSize'; +import { useCallPreferences } from '$state/hooks/callPreferences'; import * as css from './styles.css'; import { ChatButton, @@ -25,11 +31,6 @@ import { SoundButton, VideoButton, } from './Controls'; -import { CallEmbed, useCallControlState } from '../../plugins/call'; -import { stopPropagation } from '../../utils/keyboard'; -import { AsyncStatus, useAsyncCallback } from '../../hooks/useAsyncCallback'; -import { useRoom } from '../../hooks/useRoom'; -import { ScreenSize, useScreenSizeContext } from '../../hooks/useScreenSize'; type CallControlsProps = { callEmbed: CallEmbed; @@ -45,6 +46,12 @@ export function CallControls({ callEmbed }: CallControlsProps) { callEmbed.control ); + const { setPreferences } = useCallPreferences(); + + useEffect(() => { + setPreferences({ microphone, video, sound }); + }, [microphone, video, sound, setPreferences]); + const [cords, setCords] = useState(); const handleOpenMenu: MouseEventHandler = (evt) => { diff --git a/src/app/state/hooks/callPreferences.ts b/src/app/state/hooks/callPreferences.ts index 829ed4b43..d02700f05 100644 --- a/src/app/state/hooks/callPreferences.ts +++ b/src/app/state/hooks/callPreferences.ts @@ -18,6 +18,7 @@ export const useCallPreferences = (): CallPreferences & { toggleMicrophone: () => void; toggleVideo: () => void; toggleSound: () => void; + setPreferences: (prefs: CallPreferences) => void; } => { const callPrefAtom = useCallPreferencesAtom(); const [pref, setPref] = useAtom(callPrefAtom); @@ -57,5 +58,6 @@ export const useCallPreferences = (): CallPreferences & { toggleMicrophone, toggleVideo, toggleSound, + setPreferences: setPref, }; }; From 78fa0c1d9c87c2dbcb8f8c980b2cc68a2cbf17ae Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 13 Mar 2026 14:17:13 -0500 Subject: [PATCH 2/2] Create fix_call_preferences.md --- .changeset/fix_call_preferences.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix_call_preferences.md diff --git a/.changeset/fix_call_preferences.md b/.changeset/fix_call_preferences.md new file mode 100644 index 000000000..b089563a1 --- /dev/null +++ b/.changeset/fix_call_preferences.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix call preferences not persisting.