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

View file

@ -249,11 +249,11 @@ Discourse.User = Discourse.Model.extend({
@returns A stream of the user's actions containing the action of id
**/
loadUserAction: function(id) {
var user = this;
var stream = this.get('stream');
var self = this,
stream = this.get('stream');
return Discourse.ajax("/user_actions/" + id + ".json", { cache: 'false' }).then(function(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)]);
stream.set('itemsLoaded', stream.get('itemsLoaded') + 1);
stream.get('content').insertAt(0, action[0]);