Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit dashboardRoute to be a function #378

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions client/entry.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ AccountsEntry =
Session.set('entryError', t9n('error.signInRequired'))
router.next()

dashboardRoute: ->
if 'function' is typeof @settings.dashboardRoute
@settings.dashboardRoute()
else
@settings.dashboardRoute

@AccountsEntry = AccountsEntry


Expand Down
2 changes: 1 addition & 1 deletion client/views/enrollAccount/enrollAccount.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ Template.entryEnrollAccount.events
Session.set('entryError', (error.reason || "Unknown error"))
else
Session.set('resetToken', null)
Router.go AccountsEntry.settings.dashboardRoute
Router.go AccountsEntry.dashboardRoute()
2 changes: 1 addition & 1 deletion client/views/resetPassword/resetPassword.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ Template.entryResetPassword.events
Session.set('entryError', (error.reason || "Unknown error"))
else
Session.set('resetToken', null)
Router.go AccountsEntry.settings.dashboardRoute
Router.go AccountsEntry.dashboardRoute()
2 changes: 1 addition & 1 deletion client/views/signIn/signIn.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ AccountsEntry.entrySignInEvents = {
Router.go Session.get('fromWhere')
Session.set('fromWhere', undefined)
else
Router.go AccountsEntry.settings.dashboardRoute
Router.go AccountsEntry.dashboardRoute()
)
}

Expand Down
2 changes: 1 addition & 1 deletion client/views/signUp/signUp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ AccountsEntry.entrySignUpEvents = {
Router.go Session.get('fromWhere')
Session.set 'fromWhere', undefined
else
Router.go AccountsEntry.settings.dashboardRoute
Router.go AccountsEntry.dashboardRoute()

else
if AccountsEntry.settings.emailVerificationPendingRoute
Expand Down
2 changes: 1 addition & 1 deletion client/views/social/social.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Template.entrySocial.events
Router.go Session.get('fromWhere')
Session.set('fromWhere', undefined)
else
Router.go AccountsEntry.settings.dashboardRoute
Router.go AccountsEntry.dashboardRoute()
else if (err instanceof Accounts.LoginCancelledError)
# do nothing
else if (err instanceof ServiceConfiguration.ConfigError)
Expand Down
2 changes: 1 addition & 1 deletion shared/router.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Router.map ->
@next()
onRun: ->
if Meteor.userId()
Router.go AccountsEntry.settings.dashboardRoute
Router.go AccountsEntry.dashboardRoute()

if AccountsEntry.settings.signInTemplate
@template = AccountsEntry.settings.signInTemplate
Expand Down