Don't show autocompile for users signed up after release date

This commit is contained in:
Alasdair Smith 2017-09-28 13:57:15 +01:00
parent f2c0bf5515
commit 3e2388a7de

View file

@ -250,9 +250,16 @@ module.exports = ProjectController =
return cb(null, true)
showAutoCompileOnboarding: (cb) ->
cb = underscore.once(cb)
if (!user_id?)
if !user_id?
return cb()
timestamp = user_id.toString().substring(0,8)
userSignupDate = new Date( parseInt( timestamp, 16 ) * 1000 )
if userSignupDate > new Date("2017-10-05")
# Don't show for users who registered after it was released
return cb(null, false)
timeout = setTimeout cb, 500
AnalyticsManager.getLastOccurance user_id, "shown-autocompile-onboarding", (error, event) ->
clearTimeout timeout
if error?
return cb(null, false)
else if event?