1- import { MouseEventHandler , useCallback , useRef , useState } from 'react' ;
1+ import { MouseEventHandler , useCallback , useEffect , useRef , useState } from 'react' ;
22import {
33 Box ,
44 Button ,
@@ -15,7 +15,13 @@ import {
1515 toRem ,
1616} from 'folds' ;
1717import FocusTrap from 'focus-trap-react' ;
18- import { SequenceCard } from '../../components/sequence-card' ;
18+ import { SequenceCard } from '$components/sequence-card' ;
19+ import { CallEmbed , useCallControlState } from '$plugins/call' ;
20+ import { stopPropagation } from '$utils/keyboard' ;
21+ import { AsyncStatus , useAsyncCallback } from '$hooks/useAsyncCallback' ;
22+ import { useRoom } from '$hooks/useRoom' ;
23+ import { ScreenSize , useScreenSizeContext } from '$hooks/useScreenSize' ;
24+ import { useCallPreferences } from '$state/hooks/callPreferences' ;
1925import * as css from './styles.css' ;
2026import {
2127 ChatButton ,
@@ -25,11 +31,6 @@ import {
2531 SoundButton ,
2632 VideoButton ,
2733} from './Controls' ;
28- import { CallEmbed , useCallControlState } from '../../plugins/call' ;
29- import { stopPropagation } from '../../utils/keyboard' ;
30- import { AsyncStatus , useAsyncCallback } from '../../hooks/useAsyncCallback' ;
31- import { useRoom } from '../../hooks/useRoom' ;
32- import { ScreenSize , useScreenSizeContext } from '../../hooks/useScreenSize' ;
3334
3435type CallControlsProps = {
3536 callEmbed : CallEmbed ;
@@ -45,6 +46,12 @@ export function CallControls({ callEmbed }: CallControlsProps) {
4546 callEmbed . control
4647 ) ;
4748
49+ const { setPreferences } = useCallPreferences ( ) ;
50+
51+ useEffect ( ( ) => {
52+ setPreferences ( { microphone, video, sound } ) ;
53+ } , [ microphone , video , sound , setPreferences ] ) ;
54+
4855 const [ cords , setCords ] = useState < RectCords > ( ) ;
4956
5057 const handleOpenMenu : MouseEventHandler < HTMLButtonElement > = ( evt ) => {
0 commit comments