fix(llc): Fix Channel.removeMessage not able to remove thread message. (#1294)
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user