Fix thread panel message deleted preview (#7587)

pull/21833/head
Germain 2022-01-21 10:12:05 +00:00 committed by GitHub
parent af8b3c2714
commit 8f7fa07152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -75,6 +75,7 @@ import AccessibleButton, { ButtonEvent } from '../elements/AccessibleButton';
import { CardContext } from '../right_panel/BaseCard'; import { CardContext } from '../right_panel/BaseCard';
import { copyPlaintext } from '../../../utils/strings'; import { copyPlaintext } from '../../../utils/strings';
import { DecryptionFailureTracker } from '../../../DecryptionFailureTracker'; import { DecryptionFailureTracker } from '../../../DecryptionFailureTracker';
import RedactedBody from '../messages/RedactedBody';
const eventTileTypes = { const eventTileTypes = {
[EventType.RoomMessage]: 'messages.MessageEvent', [EventType.RoomMessage]: 'messages.MessageEvent',
@ -555,8 +556,8 @@ export default class EventTile extends React.Component<IProps, IState> {
} }
this.setState({ this.setState({
threadLastReply: thread.lastReply, threadLastReply: thread?.lastReply,
threadReplyCount: thread.length, threadReplyCount: thread?.length,
thread, thread,
}); });
}; };
@ -1475,7 +1476,10 @@ export default class EventTile extends React.Component<IProps, IState> {
> >
{ this.renderE2EPadlock() } { this.renderE2EPadlock() }
<div className="mx_EventTile_body"> <div className="mx_EventTile_body">
{ MessagePreviewStore.instance.generatePreviewForEvent(this.props.mxEvent) } { this.props.mxEvent.isRedacted()
? <RedactedBody mxEvent={this.props.mxEvent} />
: MessagePreviewStore.instance.generatePreviewForEvent(this.props.mxEvent)
}
</div> </div>
{ this.renderThreadPanelSummary() } { this.renderThreadPanelSummary() }
</div> </div>