mirror of
https://github.com/discourse/discourse.git
synced 2025-06-10 19:59:12 +08:00
Don't allow filtering by user in summary mode and vice versa. It's just confusing.
This commit is contained in:
@ -194,6 +194,8 @@ Discourse.PostStream = Em.Object.extend({
|
|||||||
@returns {Ember.Deferred} a promise that resolves when the summary stream has loaded.
|
@returns {Ember.Deferred} a promise that resolves when the summary stream has loaded.
|
||||||
**/
|
**/
|
||||||
toggleSummary: function() {
|
toggleSummary: function() {
|
||||||
|
var userFilters = this.get('userFilters');
|
||||||
|
userFilters.clear();
|
||||||
this.toggleProperty('summary');
|
this.toggleProperty('summary');
|
||||||
return this.refresh();
|
return this.refresh();
|
||||||
},
|
},
|
||||||
@ -206,6 +208,7 @@ Discourse.PostStream = Em.Object.extend({
|
|||||||
**/
|
**/
|
||||||
toggleParticipant: function(username) {
|
toggleParticipant: function(username) {
|
||||||
var userFilters = this.get('userFilters');
|
var userFilters = this.get('userFilters');
|
||||||
|
this.set('summary', false);
|
||||||
if (userFilters.contains(username)) {
|
if (userFilters.contains(username)) {
|
||||||
userFilters.remove(username);
|
userFilters.remove(username);
|
||||||
} else {
|
} else {
|
||||||
|
@ -148,7 +148,6 @@ test("streamFilters", function() {
|
|||||||
|
|
||||||
postStream.toggleParticipant(participant.username);
|
postStream.toggleParticipant(participant.username);
|
||||||
deepEqual(postStream.get('streamFilters'), {
|
deepEqual(postStream.get('streamFilters'), {
|
||||||
filter: "summary",
|
|
||||||
username_filters: ['eviltrout']
|
username_filters: ['eviltrout']
|
||||||
}, "streamFilters contains the username we filtered");
|
}, "streamFilters contains the username we filtered");
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user