Skip to content

Commit

Permalink
fix(ClientChannel): fix session listeners still rejecting/resolving a…
Browse files Browse the repository at this point in the history
…lready resolved promises
  • Loading branch information
arthurxavierx committed Oct 19, 2016
1 parent f1b49dd commit a11fdb0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Lime/Protocol/Client/ClientChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export class ClientChannel extends Channel {
}
return session;
})
.then((session) => this.authenticateSession(identity, authentication, instance));
.then((session) => this.authenticateSession(identity, authentication, instance))
.then((session) => {
this._resetSessionListeners();
return session;
});
}

onMessage(message: Message) {}
Expand Down Expand Up @@ -157,6 +161,14 @@ export class ClientChannel extends Channel {
onSessionFinished(session: Session) {}
onSessionFailed(session: Session) {}

private _resetSessionListeners() {
this._onSessionNegotiating =
this._onSessionAuthenticating =
this._onSessionEstablished =
this._onSessionFinished =
this._onSessionFailed = () => {};
}

private _onSessionNegotiating(session: Session) {}
private _onSessionAuthenticating(session: Session) {}
private _onSessionEstablished(session: Session) {}
Expand Down

0 comments on commit a11fdb0

Please sign in to comment.