-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use single state var to track connection state of signal client #949
Conversation
🦋 Changeset detectedLatest commit: 7b0ea45 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! much cleaner
@@ -1129,7 +1130,7 @@ export default class LocalParticipant extends Participant { | |||
) { | |||
this.participantTrackPermissions = participantTrackPermissions; | |||
this.allParticipantsAllowedToSubscribe = allParticipantsAllowed; | |||
if (this.engine.client.isConnected) { | |||
if (this.engine.client.currentState < SignalConnectionState.DISCONNECTING) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be better to abstract the enum math under something like a get isDisconnected():boolean
previously we had
isConnecting
andisReconnecting
as two boolean values, with the possibility to create ambigious states.This PR instead uses a singe
SignalConnectionState
to track the current signal client connection status.(hide whitespace recommended for review)