mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Don't show onboarding for newly registered users
This commit is contained in:
parent
eb30c46458
commit
b75d0ab3eb
2 changed files with 15 additions and 2 deletions
|
@ -224,6 +224,11 @@ module.exports = ProjectController =
|
|||
cb = underscore.once(cb)
|
||||
if !user_id?
|
||||
return cb()
|
||||
timestamp = user_id.toString().substring(0,8)
|
||||
userSignupDate = new Date( parseInt( timestamp, 16 ) * 1000 )
|
||||
if userSignupDate > new Date("2017-03-09") # 8th March
|
||||
# Don't show for users who registered after it was released
|
||||
return cb(null, false)
|
||||
timeout = setTimeout cb, 500
|
||||
AnalyticsManager.getLastOccurance user_id, "shown-track-changes-onboarding-2", (error, event) ->
|
||||
clearTimeout timeout
|
||||
|
|
|
@ -13,7 +13,7 @@ describe "ProjectController", ->
|
|||
@project_id = "123213jlkj9kdlsaj"
|
||||
|
||||
@user =
|
||||
_id:"!£123213kjljkl"
|
||||
_id:"588f3ddae8ebc1bac07c9fa4"
|
||||
first_name: "bjkdsjfk"
|
||||
@settings =
|
||||
apis:
|
||||
|
@ -302,7 +302,7 @@ describe "ProjectController", ->
|
|||
name:"my proj"
|
||||
_id:"213123kjlkj"
|
||||
@user =
|
||||
_id:"123kj21k3lj"
|
||||
_id: "588f3ddae8ebc1bac07c9fa4"
|
||||
ace:
|
||||
fontSize:"massive"
|
||||
theme:"sexy"
|
||||
|
@ -381,3 +381,11 @@ describe "ProjectController", ->
|
|||
opts.showTrackChangesOnboarding.should.equal false
|
||||
done()
|
||||
@ProjectController.loadEditor @req, @res
|
||||
|
||||
it "should set showTrackChangesOnboarding = false if the user signed up after release", (done) ->
|
||||
@AuthenticationController.getLoggedInUserId.returns("58c11a608ba0d6e49e8ce5d5")
|
||||
@AnalyticsManager.getLastOccurance.yields(null, null)
|
||||
@res.render = (pageName, opts)=>
|
||||
opts.showTrackChangesOnboarding.should.equal false
|
||||
done()
|
||||
@ProjectController.loadEditor @req, @res
|
||||
|
|
Loading…
Reference in a new issue