fix(llc): Fix Channel.removeMessage not able to remove thread message. (#1294)

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2022-08-04 13:14:57 +02:00
committed by GitHub
parent 4f696ab7c7
commit b3a7ca2897
2 changed files with 13 additions and 5 deletions
+6
View File
@@ -1,3 +1,9 @@
## Upcoming
🐞 Fixed
- Fix `Channel.removeMessage` not able to remove thread message.
## 4.4.1
🐞 Fixed
@@ -1955,11 +1955,13 @@ class ChannelClientState {
// Early return in case the thread is not available
if (!newThreads.containsKey(parentId)) return;
_threads = newThreads
..update(
parentId,
(messages) => messages..removeWhere((e) => e.id == message.id),
);
// Remove thread message shown in thread page.
newThreads.update(
parentId,
(messages) => [...messages.where((e) => e.id != message.id)],
);
_threads = newThreads;
// Early return if the thread message is not shown in channel.
if (message.showInChannel == false) return;