Skip to content

Commit d0b7693

Browse files
committed
Test full browser reset
1 parent 91c19f6 commit d0b7693

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jderobot-commsmanager",
3-
"version": "1.0.12",
3+
"version": "1.0.13",
44
"main": "dist/main.js",
55
"typings": "dist/index.d.ts",
66
"scripts": {

src/components/CommsManager.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ export default class CommsManager {
2424

2525
// Private constructor to only allow single instatiation
2626
private constructor() {
27-
this.ws = new WebSocket(CommsManager.adress);
27+
try {
28+
this.ws = new WebSocket(CommsManager.adress);
29+
} catch (error) {
30+
setTimeout(function () {
31+
delete CommsManager.instance;
32+
CommsManager.instance = new CommsManager();
33+
}, 1000);
34+
return;
35+
}
2836
this.setManagerState({
2937
id: "",
3038
command: "",

0 commit comments

Comments
 (0)