Skip to content

Commit

Permalink
fix: declare channel.lastMessage return value type as possibly being …
Browse files Browse the repository at this point in the history
…undefined (#1346)
  • Loading branch information
MartinCupela authored Aug 27, 2024
1 parent 8ab721c commit 8e9bc86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ export class Channel<StreamChatGenerics extends ExtendableGenerics = DefaultGene
*
* @return {ReturnType<ChannelState<StreamChatGenerics>['formatMessage']> | undefined} Description
*/
lastMessage() {
lastMessage(): FormatMessageResponse<StreamChatGenerics> | undefined {
// get last 5 messages, sort, return the latest
// get a slice of the last 5
let min = this.state.latestMessages.length - 5;
Expand Down

0 comments on commit 8e9bc86

Please sign in to comment.