You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-16 22:01:54 +03:00
Avoid rerendering during Room unmount
might speed up room changing by a few milliseconds
This commit is contained in:
@ -85,6 +85,12 @@ module.exports = React.createClass({
|
||||
// opaque readreceipt info for each userId; used by ReadReceiptMarker
|
||||
// to manage its animations
|
||||
this._readReceiptMap = {};
|
||||
|
||||
this._isMounted = true;
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
this._isMounted = false;
|
||||
},
|
||||
|
||||
/* get the DOM node representing the given event */
|
||||
@ -201,6 +207,10 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
_isUnmounting: function() {
|
||||
return !this._isMounted;
|
||||
},
|
||||
|
||||
_getEventTiles: function() {
|
||||
var EventTile = sdk.getComponent('rooms.EventTile');
|
||||
|
||||
@ -351,6 +361,7 @@ module.exports = React.createClass({
|
||||
onWidgetLoad={this._onWidgetLoad}
|
||||
readReceipts={readReceipts}
|
||||
readReceiptMap={this._readReceiptMap}
|
||||
checkUnmounting={this._isUnmounting}
|
||||
eventSendStatus={mxEv.status}
|
||||
last={last} isSelectedEvent={highlight}/>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user