Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Ensure read receipts end up with a valid reference to checkUnmounting #3688

Merged
merged 1 commit into from
Nov 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/structures/MessagePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ export default class MessagePanel extends React.Component {

const readReceipts = this._readReceiptsByEvent[eventId];

// Dev note: `this._isUnmounting.bind(this)` is important - it ensures that
// the function is run in the context of this class and not EventTile, therefore
// ensuring the right `this._mounted` variable is used by read receipts (which
// don't update their position if we, the MessagePanel, is unmounting).
ret.push(
<li key={eventId}
ref={this._collectEventNode.bind(this, eventId)}
Expand All @@ -707,7 +711,7 @@ export default class MessagePanel extends React.Component {
readReceipts={readReceipts}
readReceiptMap={this._readReceiptMap}
showUrlPreview={this.props.showUrlPreview}
checkUnmounting={this._isUnmounting}
checkUnmounting={this._isUnmounting.bind(this)}
eventSendStatus={mxEv.getAssociatedStatus()}
tileShape={this.props.tileShape}
isTwelveHour={this.props.isTwelveHour}
Expand Down