Fix react warnings when a RR animation is happening during room switch

If the animation of an RR removal is active when we change room, we end up
getting a callback after the RoomView has been unmounted. Guard against this to
avoid getting React warnings.
pull/21833/head
Richard van der Hoff 2016-02-02 17:59:11 +00:00
parent 20f77d1224
commit 3b1ed3a014
1 changed files with 1 additions and 1 deletions

View File

@ -915,7 +915,7 @@ module.exports = React.createClass({
var hr;
hr = (<hr className="mx_RoomView_myReadMarker" style={{opacity: 1, width: '99%'}} ref={function(n) {
Velocity(n, {opacity: '0', width: '10%'}, {duration: 400, easing: 'easeInSine', delay: 1000, complete: function() {
self.setState({readMarkerGhostEventId: undefined});
if (!self.unmounted) self.setState({readMarkerGhostEventId: undefined});
}});
}} />);
ret.splice(ghostIndex, 0, (