You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-03 00:33:22 +03:00
Render thread summary for events discovered on scrollback (#7925)
This commit is contained in:
@@ -628,11 +628,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
|||||||
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
|
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
|
||||||
const thread = room?.threads.get(this.props.mxEvent.getId());
|
const thread = room?.threads.get(this.props.mxEvent.getId());
|
||||||
|
|
||||||
if (!thread || thread.length === 0) {
|
return thread || null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return thread;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderThreadPanelSummary(): JSX.Element | null {
|
private renderThreadPanelSummary(): JSX.Element | null {
|
||||||
@@ -676,7 +672,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
|||||||
return (
|
return (
|
||||||
<p className="mx_ThreadSummaryIcon">{ _t("From a thread") }</p>
|
<p className="mx_ThreadSummaryIcon">{ _t("From a thread") }</p>
|
||||||
);
|
);
|
||||||
} else if (this.state.threadReplyCount && this.props.mxEvent.isThreadRoot) {
|
} else if (this.state.threadReplyCount && this.state.thread.id === this.props.mxEvent.getId()) {
|
||||||
let count: string | number = this.state.threadReplyCount;
|
let count: string | number = this.state.threadReplyCount;
|
||||||
if (!this.context.narrow) {
|
if (!this.context.narrow) {
|
||||||
count = _t("%(count)s reply", {
|
count = _t("%(count)s reply", {
|
||||||
@@ -1303,13 +1299,10 @@ export default class EventTile extends React.Component<IProps, IState> {
|
|||||||
|| this.state.hover
|
|| this.state.hover
|
||||||
|| this.state.actionBarFocused);
|
|| this.state.actionBarFocused);
|
||||||
|
|
||||||
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
|
|
||||||
const thread = room?.findThreadForEvent?.(this.props.mxEvent);
|
|
||||||
|
|
||||||
// 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
|
const ts = this.context.timelineRenderingType !== TimelineRenderingType.ThreadsList
|
||||||
? this.props.mxEvent.getTs()
|
? this.props.mxEvent.getTs()
|
||||||
: thread?.replyToEvent.getTs();
|
: this.state.thread?.replyToEvent.getTs();
|
||||||
|
|
||||||
const messageTimestamp = <MessageTimestamp
|
const messageTimestamp = <MessageTimestamp
|
||||||
showRelative={this.context.timelineRenderingType === TimelineRenderingType.ThreadsList}
|
showRelative={this.context.timelineRenderingType === TimelineRenderingType.ThreadsList}
|
||||||
|
|||||||
Reference in New Issue
Block a user