Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Try to automatically reconnect to websocket when disconnected. Fixes #42
Browse files Browse the repository at this point in the history
.
  • Loading branch information
dessalines committed Jan 23, 2018
1 parent 4c80ad4 commit 245796d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/src/app/components/poll/poll.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export class PollComponent implements OnInit {

if (!this.websocketSoftClose) {
console.log('ws connection closed');
this.reconnectModal.show();
//this.reconnectModal.show();
this.websocketReconnect();

}
});
}
Expand All @@ -123,6 +125,7 @@ export class PollComponent implements OnInit {
this.pollService.connect(this.pollId);
this.subscribeToPoll();
this.reconnectModal.hide();
console.log('Reconnecting to websocket');
}

update(dataStr: string) {
Expand Down

0 comments on commit 245796d

Please sign in to comment.