From 0542c69b66686b3c28eba20861a013230b579dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 24 Jun 2021 14:13:27 +0200 Subject: [PATCH] Fix types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/Notifier.ts | 2 +- src/TextForEvent.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Notifier.ts b/src/Notifier.ts index 4f55046e72..2afc7d9901 100644 --- a/src/Notifier.ts +++ b/src/Notifier.ts @@ -68,7 +68,7 @@ export const Notifier = { // or not pendingEncryptedEventIds: [], - notificationMessageForEvent: function(ev: MatrixEvent) { + notificationMessageForEvent: function(ev: MatrixEvent): string { if (typehandlers.hasOwnProperty(ev.getContent().msgtype)) { return typehandlers[ev.getContent().msgtype](ev); } diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index 50bdae8ca9..4c2c264439 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -669,6 +669,7 @@ export function hasText(ev): boolean { return Boolean(handler?.(ev)); } +export function textForEvent(ev: MatrixEvent): string export function textForEvent(ev: MatrixEvent, allowJSX = false): string | JSX.Element { const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()]; return handler?.(ev, allowJSX)?.() || '';