(newState: VoiceState)
| 273 | onErrorRef.current = onError |
| 274 | |
| 275 | function updateState(newState: VoiceState): void { |
| 276 | stateRef.current = newState |
| 277 | setState(newState) |
| 278 | setVoiceState(prev => { |
| 279 | if (prev.voiceState === newState) return prev |
| 280 | return { ...prev, voiceState: newState } |
| 281 | }) |
| 282 | } |
| 283 | |
| 284 | const cleanup = useCallback((): void => { |
| 285 | // Stale any in-flight session (main connection isStale(), replay |
no outgoing calls
no test coverage detected