From 4805e68fcd8d8c0d8469719006c7eafaa2e0ee6b Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 8 Dec 2024 12:25:43 +0800 Subject: [PATCH] :bug: Fix deleting message issue --- lib/controllers/chat_message_controller.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/controllers/chat_message_controller.dart b/lib/controllers/chat_message_controller.dart index 10b9ca3..1aca23b 100644 --- a/lib/controllers/chat_message_controller.dart +++ b/lib/controllers/chat_message_controller.dart @@ -162,6 +162,7 @@ class ChatMessageController extends ChangeNotifier { } Future _applyMessage(SnChatMessage message) async { + print(message.toJson()); if (message.channelId != channel?.id) return; switch (message.type) { @@ -257,7 +258,6 @@ class ChatMessageController extends ChangeNotifier { await _sn.client.delete( '/cgi/im/channels/${channel!.keyPath}/messages/${message.id}', ); - messages.removeWhere((x) => x.id == message.id); } catch (err) { // ignore }