Don't allow filtering by user in summary mode and vice versa. It's just confusing.

This commit is contained in:
Robin Ward 2013-12-06 13:53:19 -05:00
parent b646495798
commit 8cc6cd933a
2 changed files with 3 additions and 1 deletions

View File

@ -194,6 +194,8 @@ Discourse.PostStream = Em.Object.extend({
@returns {Ember.Deferred} a promise that resolves when the summary stream has loaded.
**/
toggleSummary: function() {
var userFilters = this.get('userFilters');
userFilters.clear();
this.toggleProperty('summary');
return this.refresh();
},
@ -206,6 +208,7 @@ Discourse.PostStream = Em.Object.extend({
**/
toggleParticipant: function(username) {
var userFilters = this.get('userFilters');
this.set('summary', false);
if (userFilters.contains(username)) {
userFilters.remove(username);
} else {

View File

@ -148,7 +148,6 @@ test("streamFilters", function() {
postStream.toggleParticipant(participant.username);
deepEqual(postStream.get('streamFilters'), {
filter: "summary",
username_filters: ['eviltrout']
}, "streamFilters contains the username we filtered");
});