Make TS happy

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-06-24 14:31:04 +02:00
parent 0542c69b66
commit e436e28f01
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -669,7 +669,8 @@ export function hasText(ev): boolean {
return Boolean(handler?.(ev)); return Boolean(handler?.(ev));
} }
export function textForEvent(ev: MatrixEvent): string export function textForEvent(ev: MatrixEvent): string;
export function textForEvent(ev: MatrixEvent, allowJSX: true): string | JSX.Element;
export function textForEvent(ev: MatrixEvent, allowJSX = false): string | JSX.Element { export function textForEvent(ev: MatrixEvent, allowJSX = false): string | JSX.Element {
const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()]; const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()];
return handler?.(ev, allowJSX)?.() || ''; return handler?.(ev, allowJSX)?.() || '';