Current implementation of controllers makes it hard to implement favicon
changes outside of build/job controllers. The problem is that if a job
is viewed, both controller are populated, which means they will both
send state change events to change favicon. This commit adds a check for
build controller, which allows to disable state change events when we're
viewing a job
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.
When transitioning from recent route to a specific repo deactivate is
not called for some reason on Safari. It seems like a bug in Ember.js,
but I need to investigate more.
A solution is to also try to remove observer in reset controller
In search there was a check on 'auth' in the view and we no longer
inject auth into views. That's why the check needs to be done on the
controller.
The other thing is that slash breaks the URL currently, so this commit
also changes slash in the search phrase into %2F character.
If user switches to recent repos tab and then switches away, there's really no
point in pushing everything into store. We can still reject all of the events
for repos that don't belong to the current user and are not yet in the store.
If user is logged in and doesn't keep 'recent repositories' tab opened, most of
the pusher events from 'common' channel are useless.
This commit introduces a logic to reject pusher events if:
* recent tab hasn't been opened
* user is signed in
* Travis CI for open source is used
* repository for a given event is not yet in store
* repository for a given event is not part of current user's repositories