Wrap all EventTiles with a TileErrorBoundary and guard parsePermalink (#7916)
Co-authored-by: Travis Ralston <travisr@matrix.org>
This commit is contained in:
parent
08c47ac473
commit
16e67e7716
3 changed files with 49 additions and 40 deletions
|
@ -82,6 +82,7 @@ import RedactedBody from '../messages/RedactedBody';
|
|||
import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload";
|
||||
import { shouldDisplayReply } from '../../../utils/Reply';
|
||||
import PosthogTrackers from "../../../PosthogTrackers";
|
||||
import TileErrorBoundary from '../messages/TileErrorBoundary';
|
||||
|
||||
export type GetRelationsForEvent = (eventId: string, relationType: string, eventType: string) => Relations;
|
||||
|
||||
|
@ -1114,7 +1115,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
|||
return false;
|
||||
}
|
||||
|
||||
render() {
|
||||
private renderEvent() {
|
||||
const msgtype = this.props.mxEvent.getContent().msgtype;
|
||||
const eventType = this.props.mxEvent.getType() as EventType;
|
||||
const {
|
||||
|
@ -1641,6 +1642,12 @@ export default class EventTile extends React.Component<IProps, IState> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public render() {
|
||||
return <TileErrorBoundary mxEvent={this.props.mxEvent} layout={this.props.layout}>
|
||||
{ this.renderEvent() }
|
||||
</TileErrorBoundary>;
|
||||
}
|
||||
}
|
||||
|
||||
// XXX this'll eventually be dynamic based on the fields once we have extensible event types
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue