Remove "active" property of proxyPairs

Use their existence in the proxy pair list to indicate they are active.
This commit is contained in:
Cecylia Bocovich 2019-10-18 17:28:53 -04:00
parent d186fcd401
commit 789285e0df
2 changed files with 25 additions and 42 deletions

View file

@ -85,9 +85,6 @@ class ProxyPair {
prepareDataChannel(channel) {
channel.onopen = () => {
log('WebRTC DataChannel opened!');
if (!this.active) {
return;
}
snowflake.ui.setActive(true);
// This is the point when the WebRTC datachannel is done, so the next step
// is to establish websocket to the server.
@ -179,17 +176,13 @@ class ProxyPair {
if (this.webrtcIsReady()) {
this.client.close();
}
this.client = null;
if (this.peerConnOpen()) {
this.pc.close();
}
this.pc = null;
if (this.relayIsReady()) {
this.relay.close();
}
this.relay = null;
this.onCleanup();
this.active = false;
}
flush() {
@ -253,8 +246,6 @@ ProxyPair.prototype.relay = null; // websocket
ProxyPair.prototype.timer = 0;
ProxyPair.prototype.active = false; // Whether serving a client.
ProxyPair.prototype.flush_timeout_id = null;
ProxyPair.prototype.onCleanup = null;