Skip to content

Commit

Permalink
Merge pull request #356 from webcompat/345/1
Browse files Browse the repository at this point in the history
Fix flash error when clicking label from /issues and not logged in.
  • Loading branch information
magsout committed Nov 7, 2014
2 parents 2c02713 + 1866cd2 commit 321d53b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions webcompat/static/js/lib/issue-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ issueList.IssueView = Backbone.View.extend({
}));
return this;
},
_isLoggedIn: $('body').data('username'),
initPaginationLinks: function() {
// if either the next or previous page numbers are null
// disable the buttons and add .is-disabled classes.
Expand All @@ -284,7 +285,9 @@ issueList.IssueView = Backbone.View.extend({
// "search:update" event to populate the view with search results
// for the given label.
var labelFilter = 'label:' + $(e.target).text();
issueList.events.trigger('search:update', labelFilter);
if (this._isLoggedIn) {
issueList.events.trigger('search:update', labelFilter);
}
issueList.events.trigger('issues:update', {query: labelFilter});
e.preventDefault();
},
Expand Down Expand Up @@ -340,7 +343,7 @@ issueList.MainView = Backbone.View.extend({
this.filter = new issueList.FilterView();
this.paginationControls = new issueList.PaginationControlsView();
// only init the SearchView if the user is logged in.
if (this.isLoggedIn) {
if (this._isLoggedIn) {
this.search = new issueList.SearchView();
}

Expand All @@ -352,12 +355,12 @@ issueList.MainView = Backbone.View.extend({
this.filter.render();
this.issueSorter.render();

if (this.isLoggedIn) {
if (this._isLoggedIn) {
this.search.render();
}
}, this));
},
isLoggedIn: $('body').data('username')
_isLoggedIn: $('body').data('username')
});

//Not using a router, so kick off things manually
Expand Down

0 comments on commit 321d53b

Please sign in to comment.