diff --git a/src/events/EventTileFactory.tsx b/src/events/EventTileFactory.tsx index 48d2090c4d738286dd4c556ab46fb4e3a93073ae..99c77fa172c38b77868d7c23566bd174f1d77af3 100644 --- a/src/events/EventTileFactory.tsx +++ b/src/events/EventTileFactory.tsx @@ -264,7 +264,6 @@ export function renderTile( mxEvent: props.mxEvent, forExport: props.forExport, highlights: props.highlights, - showUrlPreview: props.showUrlPreview, }, undefined, ); @@ -300,14 +299,13 @@ export function renderTile( mxEvent: props.mxEvent, forExport: props.forExport, highlights: props.highlights, - showUrlPreview: props.showUrlPreview, }, - () => + (origProps) => factory(props.ref, { mxEvent, highlights, highlightLink, - showUrlPreview, + showUrlPreview: origProps?.showUrlPreview ?? showUrlPreview, editState, replacingEventId, getRelationsForEvent, @@ -322,9 +320,8 @@ export function renderTile( mxEvent: props.mxEvent, forExport: props.forExport, highlights: props.highlights, - showUrlPreview: props.showUrlPreview, }, - () => + (origProps) => factory(ref, { // NEARLY ALL THE OPTIONS! mxEvent, @@ -333,7 +330,7 @@ export function renderTile( editState, highlights, highlightLink, - showUrlPreview, + showUrlPreview: origProps?.showUrlPreview ?? showUrlPreview, permalinkCreator, callEventGrouper, getRelationsForEvent, @@ -366,7 +363,6 @@ export function renderReplyTile( mxEvent: props.mxEvent, forExport: props.forExport, highlights: props.highlights, - showUrlPreview: props.showUrlPreview, }, undefined, ); @@ -392,14 +388,13 @@ export function renderReplyTile( mxEvent: props.mxEvent, forExport: props.forExport, highlights: props.highlights, - showUrlPreview: props.showUrlPreview, }, - () => + (origProps) => factory(ref, { mxEvent, highlights, highlightLink, - showUrlPreview, + showUrlPreview: origProps?.showUrlPreview ?? showUrlPreview, overrideBodyTypes, overrideEventTypes, replacingEventId, diff --git a/src/modules/customComponentApi.tsx b/src/modules/customComponentApi.tsx index 383a97bf6a12855ab935e821ca573fa0345401f4..fabb7fc6f590dfc91e63ddc431c00f5daec3be80 100644 --- a/src/modules/customComponentApi.tsx +++ b/src/modules/customComponentApi.tsx @@ -9,6 +9,7 @@ import type { CustomComponentsApi as ICustomComponentsApi, CustomMessageRenderFunction, CustomMessageComponentProps, + OriginalComponentProps, } from "@element-hq/element-web-module-api"; import type React from "react"; @@ -30,7 +31,7 @@ export class CustomComponentsApi implements ICustomComponentsApi { */ public renderMessage( props: CustomMessageComponentProps, - originalComponent?: () => React.JSX.Element, + originalComponent?: (props?: OriginalComponentProps) => React.JSX.Element, ): React.JSX.Element | null { for (const renderer of this.registeredMessageRenderers.filter((e) => props.mxEvent.getType().match(e.eventType),