mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Make MODE a class constant
This commit is contained in:
parent
6b002c5f22
commit
9df66b15b1
4 changed files with 20 additions and 19 deletions
|
@ -29,12 +29,6 @@ config = {
|
|||
]
|
||||
}
|
||||
|
||||
# Janky state machine
|
||||
MODE =
|
||||
INIT: 0
|
||||
WEBRTC_CONNECTING: 1
|
||||
WEBRTC_READY: 2
|
||||
|
||||
CONFIRMATION_MESSAGE = 'You\'re currently serving a Tor user via Snowflake.'
|
||||
|
||||
snowflake = null
|
||||
|
@ -80,7 +74,7 @@ init = () ->
|
|||
|
||||
# Notification of closing tab with active proxy.
|
||||
window.onbeforeunload = ->
|
||||
if !silenceNotifications && MODE.WEBRTC_READY == snowflake.state
|
||||
if !silenceNotifications && Snowflake.MODE.WEBRTC_READY == snowflake.state
|
||||
return CONFIRMATION_MESSAGE
|
||||
null
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue