Merge pull request #876 from GetStream/thread-fix

fix(llc): thread message deletion
This commit is contained in:
Salvatore Giordano
2022-01-31 14:51:36 +01:00
committed by GitHub
2 changed files with 11 additions and 1 deletions
@@ -1730,7 +1730,13 @@ class ChannelClientState {
if (replyCount == null || replyCount == 0) return;
addMessage(parentMessage.copyWith(replyCount: replyCount - 1));
updateThreadInfo(parentId, threads[parentId]!..remove(message));
updateThreadInfo(
parentId,
threads[parentId]!
..removeWhere(
(e) => e.id == message.id,
),
);
} else {
// Remove regular message
final allMessages = [...messages];