diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 98057e32cd..cd7824ca50 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -48,7 +48,6 @@ import DateSeparator from '../views/messages/DateSeparator'; import ErrorBoundary from '../views/elements/ErrorBoundary'; import ResizeNotifier from "../../utils/ResizeNotifier"; import Spinner from "../views/elements/Spinner"; -import TileErrorBoundary from '../views/messages/TileErrorBoundary'; import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; import EditorStateTransfer from "../../utils/EditorStateTransfer"; import { Action } from '../../dispatcher/actions'; @@ -787,37 +786,36 @@ export default class MessagePanel extends React.Component { const callEventGrouper = this.props.callEventGroupers.get(mxEv.getContent().call_id); // use txnId as key if available so that we don't remount during sending ret.push( - - - , + , ); return ret; diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index fa2ef79829..7837702473 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -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 { 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 { } } } + + public render() { + return + { this.renderEvent() } + ; + } } // XXX this'll eventually be dynamic based on the fields once we have extensible event types diff --git a/src/utils/permalinks/Permalinks.ts b/src/utils/permalinks/Permalinks.ts index ebd789267b..1958904f8a 100644 --- a/src/utils/permalinks/Permalinks.ts +++ b/src/utils/permalinks/Permalinks.ts @@ -422,13 +422,17 @@ function getPermalinkConstructor(): PermalinkConstructor { } export function parsePermalink(fullUrl: string): PermalinkParts { - const elementPrefix = SdkConfig.get()['permalinkPrefix']; - if (decodeURIComponent(fullUrl).startsWith(matrixtoBaseUrl)) { - return new MatrixToPermalinkConstructor().parsePermalink(decodeURIComponent(fullUrl)); - } else if (fullUrl.startsWith("matrix:")) { - return new MatrixSchemePermalinkConstructor().parsePermalink(fullUrl); - } else if (elementPrefix && fullUrl.startsWith(elementPrefix)) { - return new ElementPermalinkConstructor(elementPrefix).parsePermalink(fullUrl); + try { + const elementPrefix = SdkConfig.get()['permalinkPrefix']; + if (decodeURIComponent(fullUrl).startsWith(matrixtoBaseUrl)) { + return new MatrixToPermalinkConstructor().parsePermalink(decodeURIComponent(fullUrl)); + } else if (fullUrl.startsWith("matrix:")) { + return new MatrixSchemePermalinkConstructor().parsePermalink(fullUrl); + } else if (elementPrefix && fullUrl.startsWith(elementPrefix)) { + return new ElementPermalinkConstructor(elementPrefix).parsePermalink(fullUrl); + } + } catch (e) { + logger.error("Failed to parse permalink", e); } return null; // not a permalink we can handle