diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 3b0dbc03ac..b7e8a22669 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -294,7 +294,6 @@ module.exports = React.createClass({ // Wrap consecutive member events in a ListSummary if (isMembershipChange(mxEv)) { - let summarisedEvents = [mxEv]; i++; for (;i < this.props.events.length; i++) { @@ -306,15 +305,14 @@ module.exports = React.createClass({ } summarisedEvents.push(collapsedMxEv); } - - let renderEvents = (events) => { + let renderEvents = (pEvent, events) => { if (events.length === 0) { return null; } return events.map( (e) => { - // e, e to prevent date seperators - let ret = this._getTilesForEvent(e, e); + let ret = this._getTilesForEvent(pEvent, e); + pEvent = e; return ret; } ).reduce((a,b) => a.concat(b)); @@ -322,11 +320,11 @@ module.exports = React.createClass({ ret.push( ); - // Use the first member event to create scroll token - ret.push(
  • ); + prevEvent = mxEv; continue; } diff --git a/src/components/views/elements/MemberEventListSummary.js b/src/components/views/elements/MemberEventListSummary.js index d0072fc71d..c563a7d420 100644 --- a/src/components/views/elements/MemberEventListSummary.js +++ b/src/components/views/elements/MemberEventListSummary.js @@ -31,6 +31,7 @@ module.exports = React.createClass({ threshold: React.PropTypes.number, // The function to render events if they are not being summarised renderEvents: React.PropTypes.function, + previousEvent: React.PropTypes.object, }, getInitialState: function() { @@ -190,7 +191,7 @@ module.exports = React.createClass({ let expandedEvents = null; if (expanded) { - expandedEvents = this.props.renderEvents(eventsToRender); + expandedEvents = this.props.renderEvents(this.props.previousEvent, eventsToRender); } let avatars = this.renderAvatars(joinEvents.concat(leaveEvents));