🐛 Fix editing message

This commit is contained in:
LittleSheep 2025-02-24 21:31:12 +08:00
parent c4b95d7084
commit 9e039cc532
2 changed files with 2 additions and 1 deletions

View File

@ -214,7 +214,7 @@ class ChatMessageController extends ChangeNotifier {
final idx =
messages.indexWhere((x) => x.id == message.relatedEventId);
if (idx != -1) {
final newBody = message.body;
final newBody = Map<String, dynamic>.from(message.body);
newBody.remove('related_event');
messages[idx] = messages[idx].copyWith(
body: newBody,

View File

@ -41,6 +41,7 @@ class _ChatScreenState extends State<ChatScreen> {
Future<void> _fetchWhatsNew() async {
final sn = context.read<SnNetworkProvider>();
final resp = await sn.client.get('/cgi/im/whats-new');
if (resp.data == null) return;
final List<dynamic> out = resp.data;
setState(() {
_unreadCounts = {for (var v in out) v['channel_id']: v['count']};