Open nimaje opened 3 years ago
as this.setState() only requests an state change(0) the following this.connectToSwarm()(1) could be called before this.state is updated, this will lead to problems if the assumtion here is that this.state is updated in this.connectToSwarm()
this.setState()
this.connectToSwarm()
this.state
0: https://reactjs.org/docs/react-component.html#setstate 1: https://github.com/niklabh/mattermost-plugin-webrtc-video/blob/e3513a33a52de9c2b84f1d98d400c6d7a702b17a/webapp/src/components/modals/audio_group_call/audio_group_call.jsx#L97
as
this.setState()
only requests an state change(0) the followingthis.connectToSwarm()
(1) could be called beforethis.state
is updated, this will lead to problems if the assumtion here is thatthis.state
is updated inthis.connectToSwarm()
0: https://reactjs.org/docs/react-component.html#setstate 1: https://github.com/niklabh/mattermost-plugin-webrtc-video/blob/e3513a33a52de9c2b84f1d98d400c6d7a702b17a/webapp/src/components/modals/audio_group_call/audio_group_call.jsx#L97