ui: message worker: fix leak

This commit is contained in:
undefined committed 2024-04-06 23:34:12 +08:00
1 parent 1916231f9d
commit 82670c4ecf
1 file changed
+1
@@ -33,6 +33,7 @@ function initConn(path: string, port: MessagePort, cookie: any) {
else if (conn && conn.readyState === conn.OPEN) return;
lcookie = cookie;
console.log('Init connection for', path);
conn?.close();
conn = new ReconnectingWebsocket(path);
ports.push(port);
conn.onopen = () => conn.send(cookie);