You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
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:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user