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
Simplify handling of only one member event
This commit is contained in:
@@ -182,9 +182,8 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
if (!userEvents[userId].first) {
|
if (!userEvents[userId].first) {
|
||||||
userEvents[userId].first = e;
|
userEvents[userId].first = e;
|
||||||
} else {
|
|
||||||
userEvents[userId].last = e;
|
|
||||||
}
|
}
|
||||||
|
userEvents[userId].last = e;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Populate the join/leave event arrays with events that represent what happened
|
// Populate the join/leave event arrays with events that represent what happened
|
||||||
@@ -198,10 +197,6 @@ module.exports = React.createClass({
|
|||||||
(userId) => {
|
(userId) => {
|
||||||
let firstEvent = userEvents[userId].first;
|
let firstEvent = userEvents[userId].first;
|
||||||
let lastEvent = userEvents[userId].last;
|
let lastEvent = userEvents[userId].last;
|
||||||
// Only one membership event was recorded for this userId
|
|
||||||
if (!lastEvent) {
|
|
||||||
lastEvent = firstEvent;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Membership BEFORE eventsToRender
|
// Membership BEFORE eventsToRender
|
||||||
let previousMembership = firstEvent.getPrevContent().membership || "leave";
|
let previousMembership = firstEvent.getPrevContent().membership || "leave";
|
||||||
|
|||||||
Reference in New Issue
Block a user