Skip to content

Commit

Permalink
Reimplement WebRTC controls as a hook
Browse files Browse the repository at this point in the history
This replaces the hierarchy of components that managed our WebRTC
interactions with a new `useCallState` hook which encapsulates all of
the call state management functionality.  This provides a key benefit:
we can hoist the actual state storage higher in the component tree,
which means that we won't lose call state when switching layouts between
desktop and mobile screen widths.

As a bonus, this change also corrects a bunch of things from the audio
calls implementation that would have gone awry under `StrictMode` in
React 18 due to doing side-effectful actions outside of `useEffect`
blocks.

Fixes #594.
  • Loading branch information
zarvox committed Aug 31, 2022
1 parent 1509ac2 commit fb9d6c2
Show file tree
Hide file tree
Showing 4 changed files with 922 additions and 733 deletions.
Loading

0 comments on commit fb9d6c2

Please sign in to comment.