mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Fix bug where dismissing onboarding would hide autocompile switch
This commit is contained in:
parent
326e0dd8d1
commit
6dc0561fa7
3 changed files with 9 additions and 7 deletions
|
@ -262,21 +262,21 @@ module.exports = ProjectController =
|
||||||
rolloutPercentage = 40 # Percentage of users to roll out to
|
rolloutPercentage = 40 # Percentage of users to roll out to
|
||||||
if counter % 100 > rolloutPercentage
|
if counter % 100 > rolloutPercentage
|
||||||
# Don't show if user is not part of roll out
|
# Don't show if user is not part of roll out
|
||||||
return cb(null, false)
|
return cb(null, { enabled: false, showOnboarding: false })
|
||||||
userSignupDate = new Date(timestamp * 1000)
|
userSignupDate = new Date(timestamp * 1000)
|
||||||
if userSignupDate > new Date("2017-10-16")
|
if userSignupDate > new Date("2017-10-16")
|
||||||
# Don't show for users who registered after it was released
|
# Don't show for users who registered after it was released
|
||||||
return cb(null, false)
|
return cb(null, { enabled: true, showOnboarding: false })
|
||||||
timeout = setTimeout cb, 500
|
timeout = setTimeout cb, 500
|
||||||
AnalyticsManager.getLastOccurance user_id, "shown-autocompile-onboarding", (error, event) ->
|
AnalyticsManager.getLastOccurance user_id, "shown-autocompile-onboarding", (error, event) ->
|
||||||
clearTimeout timeout
|
clearTimeout timeout
|
||||||
if error?
|
if error?
|
||||||
return cb(null, false)
|
return cb(null, { enabled: true, showOnboarding: false })
|
||||||
else if event?
|
else if event?
|
||||||
return cb(null, false)
|
return cb(null, { enabled: true, showOnboarding: false })
|
||||||
else
|
else
|
||||||
logger.log { user_id, event }, "autocompile onboarding not shown yet to this user"
|
logger.log { user_id, event }, "autocompile onboarding not shown yet to this user"
|
||||||
return cb(null, true)
|
return cb(null, { enabled: true, showOnboarding: true })
|
||||||
}, (err, results)->
|
}, (err, results)->
|
||||||
if err?
|
if err?
|
||||||
logger.err err:err, "error getting details for project page"
|
logger.err err:err, "error getting details for project page"
|
||||||
|
@ -329,7 +329,8 @@ module.exports = ProjectController =
|
||||||
trackChangesState: project.track_changes
|
trackChangesState: project.track_changes
|
||||||
showTrackChangesOnboarding: !!showTrackChangesOnboarding
|
showTrackChangesOnboarding: !!showTrackChangesOnboarding
|
||||||
showPerUserTCNotice: !!showPerUserTCNotice
|
showPerUserTCNotice: !!showPerUserTCNotice
|
||||||
showAutoCompileOnboarding: !!showAutoCompileOnboarding
|
autoCompileEnabled: !!showAutoCompileOnboarding?.enabled
|
||||||
|
showAutoCompileOnboarding: !!showAutoCompileOnboarding?.showOnboarding
|
||||||
privilegeLevel: privilegeLevel
|
privilegeLevel: privilegeLevel
|
||||||
chatUrl: Settings.apis.chat.url
|
chatUrl: Settings.apis.chat.url
|
||||||
anonymous: anonymous
|
anonymous: anonymous
|
||||||
|
|
|
@ -122,6 +122,7 @@ block requirejs
|
||||||
window.trackChangesState = data.trackChangesState;
|
window.trackChangesState = data.trackChangesState;
|
||||||
window.showTrackChangesOnboarding = #{!!showTrackChangesOnboarding};
|
window.showTrackChangesOnboarding = #{!!showTrackChangesOnboarding};
|
||||||
window.showPerUserTCNotice = #{!!showPerUserTCNotice};
|
window.showPerUserTCNotice = #{!!showPerUserTCNotice};
|
||||||
|
window.autoCompileEnabled = #{!!autoCompileEnabled};
|
||||||
window.showAutoCompileOnboarding = #{!!showAutoCompileOnboarding}
|
window.showAutoCompileOnboarding = #{!!showAutoCompileOnboarding}
|
||||||
window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)};
|
window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)};
|
||||||
window.requirejs = {
|
window.requirejs = {
|
||||||
|
|
|
@ -27,7 +27,7 @@ div.full-size.pdf(ng-controller="PdfController")
|
||||||
span.caret
|
span.caret
|
||||||
ul.dropdown-menu.dropdown-menu-left
|
ul.dropdown-menu.dropdown-menu-left
|
||||||
// Only show if on beta program or part of rollout
|
// Only show if on beta program or part of rollout
|
||||||
if user.betaProgram || showAutoCompileOnboarding
|
if user.betaProgram || autoCompileEnabled
|
||||||
li.dropdown-header #{translate("auto_compile")}
|
li.dropdown-header #{translate("auto_compile")}
|
||||||
li
|
li
|
||||||
a(href, ng-click="autocompile_enabled = true")
|
a(href, ng-click="autocompile_enabled = true")
|
||||||
|
|
Loading…
Reference in a new issue