Call super in deactivate/activate in main/recent route

The problem that I identified earlier as a Safari bug turned out to be a
bug in main/recent route. Not calling super in deactivate resulted in
code to remove observer not being executed at all.
This commit is contained in:
Piotr Sarnacki 2015-02-20 13:16:16 +01:00
parent 3417095768
commit cf9bea3ea5
2 changed files with 2 additions and 3 deletions

View File

@ -17,9 +17,6 @@ Route = TravisRoute.extend
deactivate: -> deactivate: ->
@controllerFor('repos').removeObserver('firstObject', this, 'currentRepoDidChange') @controllerFor('repos').removeObserver('firstObject', this, 'currentRepoDidChange')
resetController: ->
@controllerFor('repos').removeObserver('firstObject', this, 'currentRepoDidChange')
currentRepoDidChange: -> currentRepoDidChange: ->
if repo = @controllerFor('repos').get('firstObject') if repo = @controllerFor('repos').get('firstObject')
@controllerFor('repo').set('repo', repo) @controllerFor('repo').set('repo', repo)

View File

@ -5,9 +5,11 @@ Route = MainTabRoute.extend
reposTabName: 'recent' reposTabName: 'recent'
activate: -> activate: ->
@_super.apply(this, arguments)
@store.set('isRecentTabOpen', true) @store.set('isRecentTabOpen', true)
deactivate: -> deactivate: ->
@_super.apply(this, arguments)
@store.set('isRecentTabOpen', false) @store.set('isRecentTabOpen', false)
`export default Route` `export default Route`