From 324448563acbb07b58944409106c4f097524ade9 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 16 Nov 2016 16:07:19 +0000 Subject: [PATCH] If only one mevent, return than one Also, the net change of nil is detected as having the first and last events being _different_. The summary should only include those that have their first and last events being the _same_ because that is a net change (within the block of member events). --- src/components/views/elements/MemberEventListSummary.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/MemberEventListSummary.js b/src/components/views/elements/MemberEventListSummary.js index 4a4e8bfd1e..b460a3513e 100644 --- a/src/components/views/elements/MemberEventListSummary.js +++ b/src/components/views/elements/MemberEventListSummary.js @@ -162,10 +162,15 @@ module.exports = React.createClass({ return e.getSender() === userId; }); + if (userEvents.length === 1) { + filteredEvents.push(userEvents[0]); + return; + } + let firstEvent = userEvents[0]; let lastEvent = userEvents[userEvents.length - 1]; - if (firstEvent.getContent().membership !== lastEvent.getContent().membership) { + if (firstEvent.getContent().membership === lastEvent.getContent().membership) { filteredEvents.push(lastEvent); } }