Coalesce falsy values from TextForEvent handlers

Signed-off-by: Robin Townsend <robin@robin.town>
pull/21833/head
Robin Townsend 2021-07-13 23:26:09 -04:00
parent 8e64b73bd6
commit 6c4f0526d7
1 changed files with 1 additions and 1 deletions

View File

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