@@ -139,20 +139,19 @@ export const useCallStore = create<CallStore>((set, get) => ({
139139 setCall : ( call : IClientMediaCall ) => {
140140 cleanupCallListeners ( ) ;
141141 get ( ) . resetNativeCallId ( ) ;
142- // Update state with call info — muted/held/remoteMute/remoteHeld/contact removed in 0.2.0-rc.0 library, migrated from 0.1.3 API
143142 set ( {
144143 call,
145144 callId : call . callId ,
146145 callState : call . state ,
147- isMuted : ( call as any ) . muted ,
148- isOnHold : ( call as any ) . held ,
149- remoteMute : ( call as any ) . remoteMute ,
150- remoteHeld : ( call as any ) . remoteHeld ,
146+ isMuted : call . localParticipant . muted ,
147+ isOnHold : call . localParticipant . held ,
148+ remoteMute : call . remoteParticipants [ 0 ] ?. muted ?? false ,
149+ remoteHeld : call . remoteParticipants [ 0 ] ?. held ?? false ,
151150 contact : {
152- id : ( call as any ) . contact . id ,
153- displayName : ( call as any ) . contact . displayName ,
154- username : ( call as any ) . contact . username ,
155- sipExtension : ( call as any ) . contact . sipExtension
151+ id : call . localParticipant . contact . id ,
152+ displayName : call . localParticipant . contact . displayName ,
153+ username : call . localParticipant . contact . username ,
154+ sipExtension : call . localParticipant . contact . sipExtension
156155 } ,
157156 callStartTime : call . state === 'active' ? Date . now ( ) : null
158157 } ) ;
@@ -187,12 +186,11 @@ export const useCallStore = create<CallStore>((set, get) => ({
187186 const currentCall = get ( ) . call ;
188187 if ( ! currentCall ) return ;
189188
190- // muted/held/remoteMute/remoteHeld removed in 0.2.0-rc.0 library, migrated from 0.1.3 API
191189 set ( {
192- isMuted : ( currentCall as any ) . muted ,
193- isOnHold : ( currentCall as any ) . held ,
194- remoteMute : ( currentCall as any ) . remoteMute ,
195- remoteHeld : ( currentCall as any ) . remoteHeld ,
190+ isMuted : currentCall . localParticipant . muted ,
191+ isOnHold : currentCall . localParticipant . held ,
192+ remoteMute : currentCall . remoteParticipants [ 0 ] ?. muted ?? false ,
193+ remoteHeld : currentCall . remoteParticipants [ 0 ] ?. held ?? false ,
196194 controlsVisible : true
197195 } ) ;
198196 } ;
@@ -226,17 +224,15 @@ export const useCallStore = create<CallStore>((set, get) => ({
226224 const { call, isMuted } = get ( ) ;
227225 if ( ! call ) return ;
228226
229- // setMuted removed in 0.2.0-rc.0 library, migrated from 0.1.3 API
230- ( call as any ) . setMuted ( ! isMuted ) ;
227+ call . localParticipant . setMuted ( ! isMuted ) ;
231228 set ( { isMuted : ! isMuted } ) ;
232229 } ,
233230
234231 toggleHold : ( ) => {
235232 const { call, isOnHold } = get ( ) ;
236233 if ( ! call ) return ;
237234
238- // setHeld removed in 0.2.0-rc.0 library, migrated from 0.1.3 API
239- ( call as any ) . setHeld ( ! isOnHold ) ;
235+ call . localParticipant . setHeld ( ! isOnHold ) ;
240236 set ( { isOnHold : ! isOnHold } ) ;
241237 } ,
242238
0 commit comments