Permalink
Browse files

Simplifies and documents beforeFilter

  • Loading branch information...
Dominik Guzei
Dominik Guzei committed Jan 31, 2012
1 parent 24959c6 commit 1d1c049ff93d07fa41e9926f5df79f4a2268ae7d
Showing with 7 additions and 1 deletion.
  1. +7 −1 app/assets/javascripts/app/states/BrowsingState.js.coffee
@@ -32,11 +32,17 @@ App.states.BrowsingState = SC.State.extend {
initialSubstate: 'CreateNote'
- beforeFilter: (context) ->
+ beforeFilter: ->
unless App.mediators.authenticationMediator.get('loggedIn')
+ # don't call gotoState directly here, because there
+ # might be multiple parts of application interested in
+ # handling the login action
@get('statechart').send('login')
+
+ # don't trigger transition to substate
return false
+ # trigger transition to substate
return true
CreateNote: SC.State.extend {

0 comments on commit 1d1c049

Please sign in to comment.