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).
This commit is contained in:
parent
beecbc7cd7
commit
324448563a
1 changed files with 6 additions and 1 deletions
|
@ -162,10 +162,15 @@ module.exports = React.createClass({
|
||||||
return e.getSender() === userId;
|
return e.getSender() === userId;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (userEvents.length === 1) {
|
||||||
|
filteredEvents.push(userEvents[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let firstEvent = userEvents[0];
|
let firstEvent = userEvents[0];
|
||||||
let lastEvent = userEvents[userEvents.length - 1];
|
let lastEvent = userEvents[userEvents.length - 1];
|
||||||
|
|
||||||
if (firstEvent.getContent().membership !== lastEvent.getContent().membership) {
|
if (firstEvent.getContent().membership === lastEvent.getContent().membership) {
|
||||||
filteredEvents.push(lastEvent);
|
filteredEvents.push(lastEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue