This is an automated email from the git hooks/post-receive script.
cohosh pushed a commit to branch main in repository pluggable-transports/snowflake-webext.
commit 27300671c2866dbeb5c32a249d9aa8cca528f55a Author: WofWca wofwca@protonmail.com AuthorDate: Sun Nov 6 15:38:59 2022 +0400
refactor: fewer `this` usages --- proxypair.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/proxypair.js b/proxypair.js index bd128c8..15d6ea7 100644 --- a/proxypair.js +++ b/proxypair.js @@ -179,13 +179,13 @@ class ProxyPair { (this.relayURL === undefined) ? WS.makeWebsocket(this.relayAddr, params) : WS.makeWebsocketFromURL(this.relayURL, params); - this.relay.label = 'websocket-relay'; - this.relay.onopen = () => { + relay.label = 'websocket-relay'; + relay.onopen = () => { clearTimeout(this.connectToRelayTimeoutId); log(relay.label + ' connected!'); snowflake.ui.setStatus('connected'); }; - this.relay.onclose = () => { + relay.onclose = () => { log(relay.label + ' closed.'); snowflake.ui.setStatus('disconnected.'); if (this.counted) { @@ -195,8 +195,8 @@ class ProxyPair { this.flush(); this.close(); }; - this.relay.onerror = this.onError; - this.relay.onmessage = this.onRelayToClientMessage; + relay.onerror = this.onError; + relay.onmessage = this.onRelayToClientMessage; // TODO: Better websocket timeout handling. this.connectToRelayTimeoutId = setTimeout((() => { log(relay.label + ' timed out connecting.');