From 9cedf6ff14e9cc039722371ada3b7e0a5a2fab05 Mon Sep 17 00:00:00 2001 From: MartinCupela <32706194+MartinCupela@users.noreply.github.com> Date: Thu, 1 Feb 2024 16:07:18 +0100 Subject: [PATCH] fix: prevent channel unread count reset to 0 when sending message and on new own or thread messages (#1210) --- src/channel.ts | 32 +++++++++++++++----------------- test/unit/channel.js | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 19 deletions(-) diff --git a/src/channel.ts b/src/channel.ts index 2812c2fff..605ea3e73 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -170,18 +170,10 @@ export class Channel>} The Server Response */ async sendMessage(message: Message, options?: SendMessageOptions) { - const sendMessageResponse = await this.getClient().post>( - this._channelURL() + '/message', - { - message, - ...options, - }, - ); - - // Reset unreadCount to 0. - this.state.unreadCount = 0; - - return sendMessageResponse; + return await this.getClient().post>(this._channelURL() + '/message', { + message, + ...options, + }); } sendFile( @@ -1289,6 +1281,12 @@ export class Channel