mirror of
https://github.com/element-hq/element-web
synced 2024-11-25 18:55:58 +03:00
Animate read receipts for all component updates
This commit is contained in:
parent
8d60d85570
commit
86d2e577cf
1 changed files with 11 additions and 0 deletions
|
@ -106,7 +106,18 @@ export default class ReadReceiptMarker extends React.PureComponent {
|
||||||
// we've already done our display - nothing more to do.
|
// we've already done our display - nothing more to do.
|
||||||
return;
|
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
|
// treat new RRs as though they were off the top of the screen
|
||||||
let oldTop = -15;
|
let oldTop = -15;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue