From 9795b26bc1ea45b8dbd7fdafca8fe2d04ceb16bc Mon Sep 17 00:00:00 2001 From: lilia Date: Tue, 9 Jun 2015 12:03:28 -0700 Subject: [PATCH] Supress change event on avatarUrl initialization --- js/models/conversations.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/models/conversations.js b/js/models/conversations.js index ffb77347..f988d7f4 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -222,7 +222,7 @@ } }, - updateAvatarUrl: function() { + updateAvatarUrl: function(silent) { this.revokeAvatarUrl(); var avatar = this.get('avatar'); if (avatar) { @@ -232,12 +232,14 @@ } else { this.avatarUrl = null; } - this.trigger('change'); + if (!silent) { + this.trigger('change'); + } }, getAvatarUrl: function() { if (this.avatarUrl === undefined) { - this.updateAvatarUrl(); + this.updateAvatarUrl(true); } return this.avatarUrl || '/images/default.png'; },