🐛 Bug fixes on duplicate message

This commit is contained in:
2024-06-23 19:13:07 +08:00
parent d0cd75d653
commit 8036930084
3 changed files with 27 additions and 2 deletions

View File

@ -324,6 +324,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
slivers: [
Obx(() {
return SliverList.builder(
key: Key('chat-history#${_channel!.id}'),
itemCount: _chatController.currentHistory.length,
itemBuilder: buildHistory,
);
@ -382,7 +383,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
channel: _channel!,
onSent: (Message item) {
setState(() {
_chatController.receiveMessage(item);
_chatController.addTemporaryMessage(item);
});
},
onReset: () {