🐛 Fix deleting message issue

This commit is contained in:
LittleSheep 2024-12-08 12:25:43 +08:00
parent a693bfdc94
commit 4805e68fcd

View File

@ -162,6 +162,7 @@ class ChatMessageController extends ChangeNotifier {
}
Future<void> _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
}