Animate read receipts for all component updates

pull/21833/head
Germain Souquet 2021-04-08 10:36:38 +01:00
parent 8d60d85570
commit 86d2e577cf
1 changed files with 11 additions and 0 deletions

View File

@ -106,7 +106,18 @@ export default class ReadReceiptMarker extends React.PureComponent {
// we've already done our display - nothing more to do.
return;
}
this._animateMarker();
}
componentDidUpdate(prevProps) {
const differentLeftOffset = prevProps.leftOffset !== this.props.leftOffset;
const visibilityChanged = prevProps.hidden !== this.props.hidden;
if (differentLeftOffset || visibilityChanged) {
this._animateMarker();
}
}
_animateMarker() {
// treat new RRs as though they were off the top of the screen
let oldTop = -15;