Skip to content

Commit 4293014

Browse files
committed
Properly handle disconnections
1 parent 02b0f25 commit 4293014

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/org.tynsoe.streamdeck.wsproxy.sdPlugin/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Name": "WebSocket Proxy",
1818
"Icon": "images/websocket",
1919
"SDKVersion": 2,
20-
"Version": "1.1",
20+
"Version": "1.1.1",
2121
"PropertyInspectorPath": "plugin/inspector.html",
2222
"OS": [
2323
{

Sources/org.tynsoe.streamdeck.wsproxy.sdPlugin/plugin/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function connect(coordinates,remoteServer,message) {
1818
connections[key]=c
1919

2020
// send willAppear message when connection is ready
21-
c.onopen = function() {
21+
c.onopen = function(evt) {
2222
console.log("Remote socket opened")
2323
if (message) {
2424
c.send(JSON.stringify(message))
@@ -51,7 +51,7 @@ function disconnect(coordinates,message) {
5151
if (c.readyState == 1) {
5252
c.send(JSON.stringify(message))
5353
}
54-
connections.delete(key)
54+
delete connections[key]
5555
c.close()
5656
}
5757
}

0 commit comments

Comments
 (0)