Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

Commit 5e3eaee

Browse files
committed
fix: socket not closing when reconnecting
When users clicked the reconnect button when connected, the old socket wasn't being closed.
1 parent 26d37b0 commit 5e3eaee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

js/src/controls.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ $(document).ready(function(){
7676
e.preventDefault();
7777

7878
$("#connection").removeClass("label-success").removeClass("label-danger").addClass("label-warning").text("reconnecting");
79+
80+
if(webSocket != undefined || webSocket != null){
81+
webSocket.close();
82+
}
83+
7984
connect();
8085
});
8186
});

0 commit comments

Comments
 (0)