Skip to content

Commit

Permalink
set connection state as early as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO committed Oct 20, 2022
1 parent 4f92031 commit cba4e6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/room/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,9 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
return this.connectFuture.promise;
}

this.setAndEmitConnectionState(ConnectionState.Connecting);

const connectFn = async (resolve: () => void, reject: (reason: any) => void) => {
this.setAndEmitConnectionState(ConnectionState.Connecting);
if (!this.abortController || this.abortController.signal.aborted) {
this.abortController = new AbortController();
}
Expand Down

0 comments on commit cba4e6a

Please sign in to comment.