Start on popup

This commit is contained in:
Arlo Breault 2019-05-29 21:27:05 -04:00
parent 11efa42e4c
commit 91255463c6
6 changed files with 87 additions and 16 deletions

View file

@ -68,14 +68,14 @@ class ProxyPair
channel.onopen = =>
log 'WebRTC DataChannel opened!'
snowflake.state = Snowflake.MODE.WEBRTC_READY
snowflake.ui?.setActive true
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.
@connectRelay()
channel.onclose = =>
log 'WebRTC DataChannel closed.'
snowflake.ui?.setStatus 'disconnected by webrtc.'
snowflake.ui?.setActive false
snowflake.ui.setStatus 'disconnected by webrtc.'
snowflake.ui.setActive false
snowflake.state = Snowflake.MODE.INIT
@flush()
@close()
@ -108,11 +108,11 @@ class ProxyPair
clearTimeout @timer
@timer = 0
log @relay.label + ' connected!'
snowflake.ui?.setStatus 'connected'
snowflake.ui.setStatus 'connected'
@relay.onclose = =>
log @relay.label + ' closed.'
snowflake.ui?.setStatus 'disconnected.'
snowflake.ui?.setActive false
snowflake.ui.setStatus 'disconnected.'
snowflake.ui.setActive false
snowflake.state = Snowflake.MODE.INIT
@flush()
@close()