mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +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));
|
||||
|
||||
// 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.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
|
||||
showRelative={this.context.timelineRenderingType === TimelineRenderingType.ThreadsList}
|
||||
|
|
Loading…
Reference in a new issue