mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Add a bit of safety around timestamp handling for threads (#8845)
This commit is contained in:
parent
39f2bbaaf4
commit
44b2667f73
1 changed files with 6 additions and 2 deletions
|
@ -1121,9 +1121,13 @@ export class UnwrappedEventTile extends React.Component<IProps, IState> {
|
||||||
|| Boolean(this.state.contextMenu));
|
|| Boolean(this.state.contextMenu));
|
||||||
|
|
||||||
// Thread panel shows the timestamp of the last reply in that thread
|
// Thread panel shows the timestamp of the last reply in that thread
|
||||||
const ts = this.context.timelineRenderingType !== TimelineRenderingType.ThreadsList
|
let ts = this.context.timelineRenderingType !== TimelineRenderingType.ThreadsList
|
||||||
? this.props.mxEvent.getTs()
|
? this.props.mxEvent.getTs()
|
||||||
: this.state.thread?.replyToEvent.getTs();
|
: this.state.thread?.replyToEvent?.getTs();
|
||||||
|
if (typeof ts !== "number") {
|
||||||
|
// Fall back to something we can use
|
||||||
|
ts = this.props.mxEvent.getTs();
|
||||||
|
}
|
||||||
|
|
||||||
const messageTimestamp = <MessageTimestamp
|
const messageTimestamp = <MessageTimestamp
|
||||||
showRelative={this.context.timelineRenderingType === TimelineRenderingType.ThreadsList}
|
showRelative={this.context.timelineRenderingType === TimelineRenderingType.ThreadsList}
|
||||||
|
|
Loading…
Reference in a new issue