Skip to content

Commit

Permalink
fix(websocket): close websocket before connecting (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
goesta committed Oct 20, 2021
1 parent 62ccb1f commit 182d7f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/webSocketClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export class WebSocketClient {

connect(): void {
this.store?.dispatch('socket/setData', { isConnecting: true })

if (this.instance) {
this.instance.close()
}
this.instance = new WebSocket(this.url)

this.instance.onopen = () => {
Expand Down

0 comments on commit 182d7f1

Please sign in to comment.