From b2bed9c51c3abb501e7bd60aad03fc726270ffad Mon Sep 17 00:00:00 2001 From: lilia Date: Tue, 12 Jan 2016 10:41:24 -0800 Subject: [PATCH] Fix display of empty group updates Group updates in which nothing change should still display 'Updated the group'. Previously they would display as empty message bubbles. Fixed by ensuring that the 'group_update' attribute is set on the model, even if it is an empty object. // FREEBIE --- js/models/messages.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/models/messages.js b/js/models/messages.js index 8e8265f4..d016a9d5 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -266,7 +266,7 @@ var now = new Date().getTime(); var attributes = { type: 'private' }; if (dataMessage.group) { - var group_update = {}; + var group_update = null; attributes = { type: 'group', groupId: dataMessage.group.id, @@ -294,7 +294,7 @@ attributes.members = _.without(conversation.get('members'), source); } - if (_.keys(group_update).length > 0) { + if (group_update !== null) { message.set({group_update: group_update}); } }