From 6b52b247e729e586134e8be34bfadd8c7643beac Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 15 Dec 2016 18:26:41 +0000 Subject: [PATCH] Update comment on MELS key --- src/components/structures/MessagePanel.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 9eacca2139..c681f5105d 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -300,8 +300,11 @@ module.exports = React.createClass({ // member events. This will prevent it from being re-created unnecessarily, and // instead will allow new props to be provided. In turn, the shouldComponentUpdate // method on MELS can be used to prevent unnecessary renderings. - // `prevEvent` at this point is a non-member event or null. - const key = "memberlistsummary-" + (prevEvent ? mxEv.getId() : "initial"); + // + // Whilst back-paginating with a MELS at the top of the panel, prevEvent will be null, + // so use the key "membereventlistsummary-initial". Otherwise, use the ID of the first + // membership event, which will not change during forward pagination. + const key = "membereventlistsummary-" + (prevEvent ? mxEv.getId() : "initial"); if (this._wantsDateSeparator(prevEvent, ts1)) { let dateSeparator =
  • ;