diff --git a/lib/widgets/chat/chat_message_input.dart b/lib/widgets/chat/chat_message_input.dart index b8c443b..0565e1b 100644 --- a/lib/widgets/chat/chat_message_input.dart +++ b/lib/widgets/chat/chat_message_input.dart @@ -48,6 +48,8 @@ class ChatMessageInputState extends State { void setEdit(SnChatMessage? value) { _contentController.text = value?.body['text'] ?? ''; + _attachments.clear(); + _attachments.addAll(value?.preload?.attachments?.map((e) => PostWriteMedia(e)) ?? []); setState(() => _editingMessage = value); } @@ -199,6 +201,7 @@ class ChatMessageInputState extends State { InkWell( child: Text('cancel'.tr()), onTap: () { + _attachments.clear(); setState(() => _replyingMessage = null); }, ), @@ -238,6 +241,7 @@ class ChatMessageInputState extends State { InkWell( child: Text('cancel'.tr()), onTap: () { + _attachments.clear(); _contentController.clear(); setState(() => _editingMessage = null); },