Skip to content

Commit

Permalink
Merge pull request #99 from vulzee/bugfix/error-and-double-disconnect…
Browse files Browse the repository at this point in the history
…ed-on-stopSignalRHub

fix error and double disconnected actions on stopSignalRHub action
  • Loading branch information
Odonno authored May 27, 2023
2 parents 075107c + f8e61c5 commit 6e4998d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/projects/ngrx-signalr-core/src/lib/SignalRHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export class SignalRHub implements ISignalRHub {
);

this._connection.onclose((error) => {
this._errorSubject.next(error);
if (error) {
this._errorSubject.next(error);
}
this._stateSubject.next(disconnected);
});
this._connection.onreconnecting(() => {
Expand Down Expand Up @@ -90,7 +92,6 @@ export class SignalRHub implements ISignalRHub {
.stop()
.then((_) => {
this._stopSubject.next();
this._stateSubject.next(disconnected);
})
.catch((error) => this._errorSubject.next(error));

Expand Down

0 comments on commit 6e4998d

Please sign in to comment.