🐛 Fix deleting message issue
This commit is contained in:
parent
a693bfdc94
commit
4805e68fcd
@ -162,6 +162,7 @@ class ChatMessageController extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _applyMessage(SnChatMessage message) async {
|
Future<void> _applyMessage(SnChatMessage message) async {
|
||||||
|
print(message.toJson());
|
||||||
if (message.channelId != channel?.id) return;
|
if (message.channelId != channel?.id) return;
|
||||||
|
|
||||||
switch (message.type) {
|
switch (message.type) {
|
||||||
@ -257,7 +258,6 @@ class ChatMessageController extends ChangeNotifier {
|
|||||||
await _sn.client.delete(
|
await _sn.client.delete(
|
||||||
'/cgi/im/channels/${channel!.keyPath}/messages/${message.id}',
|
'/cgi/im/channels/${channel!.keyPath}/messages/${message.id}',
|
||||||
);
|
);
|
||||||
messages.removeWhere((x) => x.id == message.id);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user