From 8e9bc86a0764f10376368d1f829c9ed41aa0034a Mon Sep 17 00:00:00 2001 From: MartinCupela <32706194+MartinCupela@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:42:16 +0200 Subject: [PATCH] fix: declare channel.lastMessage return value type as possibly being undefined (#1346) --- src/channel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/channel.ts b/src/channel.ts index ffb9cdadc..c7edbd4ed 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -707,7 +707,7 @@ export class Channel['formatMessage']> | undefined} Description */ - lastMessage() { + lastMessage(): FormatMessageResponse | undefined { // get last 5 messages, sort, return the latest // get a slice of the last 5 let min = this.state.latestMessages.length - 5;