Initialize snowflake instance with a config

This commit is contained in:
Arlo Breault 2019-05-08 16:13:22 -04:00
parent edbbea1d03
commit 2d8a1690ba
11 changed files with 125 additions and 113 deletions

View file

@ -22,10 +22,10 @@ class Util
@genSnowflakeID: ->
Math.random().toString(36).substring(2)
@snowflakeIsDisabled = ->
@snowflakeIsDisabled = (cookieName) ->
cookies = Parse.cookie document.cookie
# Do nothing if snowflake has not been opted in by user.
if cookies[COOKIE_NAME] != '1'
if cookies[cookieName] != '1'
log 'Not opted-in. Please click the badge to change options.'
return true
# Also do nothing if running in Tor Browser.