Add missing return values in Read Receipt animation code (#8625)
This commit is contained in:
parent
796e12e789
commit
5976f59827
1 changed files with 6 additions and 12 deletions
|
@ -129,14 +129,12 @@ export default class ReadReceiptMarker extends React.PureComponent<IProps, IStat
|
||||||
// this seems to happen sometimes for reasons I don't understand
|
// this seems to happen sometimes for reasons I don't understand
|
||||||
// the docs for `offsetParent` say it may be null if `display` is
|
// the docs for `offsetParent` say it may be null if `display` is
|
||||||
// `none`, but I can't see why that would happen.
|
// `none`, but I can't see why that would happen.
|
||||||
logger.warn(
|
logger.warn(`ReadReceiptMarker for ${this.props.fallbackUserId} has no valid horizontalContainer`);
|
||||||
`ReadReceiptMarker for ${this.props.fallbackUserId} has no valid horizontalContainer`,
|
|
||||||
);
|
|
||||||
|
|
||||||
target.top = 0;
|
target.top = 0;
|
||||||
target.right = 0;
|
target.right = 0;
|
||||||
target.parent = null;
|
target.parent = null;
|
||||||
return;
|
return target;
|
||||||
}
|
}
|
||||||
// this is the mx_ReadReceiptsGroup
|
// this is the mx_ReadReceiptsGroup
|
||||||
const verticalContainer = horizontalContainer.offsetParent;
|
const verticalContainer = horizontalContainer.offsetParent;
|
||||||
|
@ -144,14 +142,12 @@ export default class ReadReceiptMarker extends React.PureComponent<IProps, IStat
|
||||||
// this seems to happen sometimes for reasons I don't understand
|
// this seems to happen sometimes for reasons I don't understand
|
||||||
// the docs for `offsetParent` say it may be null if `display` is
|
// the docs for `offsetParent` say it may be null if `display` is
|
||||||
// `none`, but I can't see why that would happen.
|
// `none`, but I can't see why that would happen.
|
||||||
logger.warn(
|
logger.warn(`ReadReceiptMarker for ${this.props.fallbackUserId} has no valid verticalContainer`);
|
||||||
`ReadReceiptMarker for ${this.props.fallbackUserId} has no valid verticalContainer`,
|
|
||||||
);
|
|
||||||
|
|
||||||
target.top = 0;
|
target.top = 0;
|
||||||
target.right = 0;
|
target.right = 0;
|
||||||
target.parent = null;
|
target.parent = null;
|
||||||
return;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
target.top = element.offsetTop;
|
target.top = element.offsetTop;
|
||||||
|
@ -165,9 +161,7 @@ export default class ReadReceiptMarker extends React.PureComponent<IProps, IStat
|
||||||
// this seems to happen sometimes for reasons I don't understand
|
// this seems to happen sometimes for reasons I don't understand
|
||||||
// the docs for `offsetParent` say it may be null if `display` is
|
// the docs for `offsetParent` say it may be null if `display` is
|
||||||
// `none`, but I can't see why that would happen.
|
// `none`, but I can't see why that would happen.
|
||||||
logger.warn(
|
logger.warn(`ReadReceiptMarker for ${this.props.fallbackUserId} has no offsetParent`);
|
||||||
`ReadReceiptMarker for ${this.props.fallbackUserId} has no offsetParent`,
|
|
||||||
);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +180,7 @@ export default class ReadReceiptMarker extends React.PureComponent<IProps, IStat
|
||||||
: -READ_AVATAR_SIZE;
|
: -READ_AVATAR_SIZE;
|
||||||
|
|
||||||
const startStyles = [];
|
const startStyles = [];
|
||||||
if (oldInfo && oldInfo.right) {
|
if (oldInfo?.right) {
|
||||||
startStyles.push({
|
startStyles.push({
|
||||||
top: oldPosition - newPosition,
|
top: oldPosition - newPosition,
|
||||||
right: oldInfo.right,
|
right: oldInfo.right,
|
||||||
|
|
Loading…
Reference in a new issue