Removed "janky" snowflake state machine

The only place it was used was in window.onpageunload, and we have a
better way of determining if the proxy is active there (through the ui).

I also removed that code from the webextension since the proxy won't
stop running unless you close the browser and after testing it looks
like that code doesn't notify the user anyway.
This commit is contained in:
Cecylia Bocovich 2019-10-18 15:10:03 -04:00
parent 338f1792b8
commit 9b470fbe4b
6 changed files with 11 additions and 36 deletions

View file

@ -1,4 +1,4 @@
/* global snowflake, log, dbg, Util, PeerConnection, Snowflake, Parse, WS */
/* global snowflake, log, dbg, Util, PeerConnection, Parse, WS */
/*
Represents a single:
@ -89,7 +89,6 @@ class ProxyPair {
return;
}
this.running = true;
snowflake.state = Snowflake.MODE.WEBRTC_READY;
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.
@ -99,7 +98,6 @@ class ProxyPair {
log('WebRTC DataChannel closed.');
snowflake.ui.setStatus('disconnected by webrtc.');
snowflake.ui.setActive(false);
snowflake.state = Snowflake.MODE.INIT;
this.flush();
return this.close();
};
@ -139,7 +137,6 @@ class ProxyPair {
log(relay.label + ' closed.');
snowflake.ui.setStatus('disconnected.');
snowflake.ui.setActive(false);
snowflake.state = Snowflake.MODE.INIT;
this.flush();
return this.close();
};