Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 5976f59

Browse files
authored
Add missing return values in Read Receipt animation code (#8625)
1 parent 796e12e commit 5976f59

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/components/views/rooms/ReadReceiptMarker.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,29 +129,25 @@ export default class ReadReceiptMarker extends React.PureComponent<IProps, IStat
129129
// this seems to happen sometimes for reasons I don't understand
130130
// the docs for `offsetParent` say it may be null if `display` is
131131
// `none`, but I can't see why that would happen.
132-
logger.warn(
133-
`ReadReceiptMarker for ${this.props.fallbackUserId} has no valid horizontalContainer`,
134-
);
132+
logger.warn(`ReadReceiptMarker for ${this.props.fallbackUserId} has no valid horizontalContainer`);
135133

136134
target.top = 0;
137135
target.right = 0;
138136
target.parent = null;
139-
return;
137+
return target;
140138
}
141139
// this is the mx_ReadReceiptsGroup
142140
const verticalContainer = horizontalContainer.offsetParent;
143141
if (!verticalContainer || !(verticalContainer instanceof HTMLElement)) {
144142
// this seems to happen sometimes for reasons I don't understand
145143
// the docs for `offsetParent` say it may be null if `display` is
146144
// `none`, but I can't see why that would happen.
147-
logger.warn(
148-
`ReadReceiptMarker for ${this.props.fallbackUserId} has no valid verticalContainer`,
149-
);
145+
logger.warn(`ReadReceiptMarker for ${this.props.fallbackUserId} has no valid verticalContainer`);
150146

151147
target.top = 0;
152148
target.right = 0;
153149
target.parent = null;
154-
return;
150+
return target;
155151
}
156152

157153
target.top = element.offsetTop;
@@ -165,9 +161,7 @@ export default class ReadReceiptMarker extends React.PureComponent<IProps, IStat
165161
// this seems to happen sometimes for reasons I don't understand
166162
// the docs for `offsetParent` say it may be null if `display` is
167163
// `none`, but I can't see why that would happen.
168-
logger.warn(
169-
`ReadReceiptMarker for ${this.props.fallbackUserId} has no offsetParent`,
170-
);
164+
logger.warn(`ReadReceiptMarker for ${this.props.fallbackUserId} has no offsetParent`);
171165
return 0;
172166
}
173167

@@ -186,7 +180,7 @@ export default class ReadReceiptMarker extends React.PureComponent<IProps, IStat
186180
: -READ_AVATAR_SIZE;
187181

188182
const startStyles = [];
189-
if (oldInfo && oldInfo.right) {
183+
if (oldInfo?.right) {
190184
startStyles.push({
191185
top: oldPosition - newPosition,
192186
right: oldInfo.right,

0 commit comments

Comments
 (0)