Skip to content

Commit 8cc6cd9

Browse files
committed
Don't allow filtering by user in summary mode and vice versa. It's just confusing.
1 parent b646495 commit 8cc6cd9

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

app/assets/javascripts/discourse/models/post_stream.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ Discourse.PostStream = Em.Object.extend({
194194
@returns {Ember.Deferred} a promise that resolves when the summary stream has loaded.
195195
**/
196196
toggleSummary: function() {
197+
var userFilters = this.get('userFilters');
198+
userFilters.clear();
197199
this.toggleProperty('summary');
198200
return this.refresh();
199201
},
@@ -206,6 +208,7 @@ Discourse.PostStream = Em.Object.extend({
206208
**/
207209
toggleParticipant: function(username) {
208210
var userFilters = this.get('userFilters');
211+
this.set('summary', false);
209212
if (userFilters.contains(username)) {
210213
userFilters.remove(username);
211214
} else {

test/javascripts/models/post_stream_test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ test("streamFilters", function() {
148148

149149
postStream.toggleParticipant(participant.username);
150150
deepEqual(postStream.get('streamFilters'), {
151-
filter: "summary",
152151
username_filters: ['eviltrout']
153152
}, "streamFilters contains the username we filtered");
154153
});

0 commit comments

Comments
 (0)