mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 08:53:41 +08:00
Don't allow filtering by user in summary mode and vice versa. It's just confusing.
This commit is contained in:
parent
b646495798
commit
8cc6cd933a
|
@ -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 {
|
||||
|
|
|
@ -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");
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user