FIX: Was not filtering correctly on the user's stream

This commit is contained in:
Robin Ward 2014-07-29 15:38:44 -04:00
parent 7cc4a157f6
commit 55457810ba
1 changed files with 3 additions and 3 deletions

View File

@ -249,11 +249,11 @@ Discourse.User = Discourse.Model.extend({
@returns A stream of the user's actions containing the action of id @returns A stream of the user's actions containing the action of id
**/ **/
loadUserAction: function(id) { loadUserAction: function(id) {
var user = this; var self = this,
var stream = this.get('stream'); stream = this.get('stream');
return Discourse.ajax("/user_actions/" + id + ".json", { cache: 'false' }).then(function(result) { return Discourse.ajax("/user_actions/" + id + ".json", { cache: 'false' }).then(function(result) {
if (result) { if (result) {
if ((user.get('streamFilter') || result.action_type) !== result.action_type) return; if ((self.get('stream.filter') || result.action_type) !== result.action_type) return;
var action = Discourse.UserAction.collapseStream([Discourse.UserAction.create(result)]); var action = Discourse.UserAction.collapseStream([Discourse.UserAction.create(result)]);
stream.set('itemsLoaded', stream.get('itemsLoaded') + 1); stream.set('itemsLoaded', stream.get('itemsLoaded') + 1);
stream.get('content').insertAt(0, action[0]); stream.get('content').insertAt(0, action[0]);