fix: fixed attachment error
This commit is contained in:
@@ -1538,7 +1538,9 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
/// Sends the current message
|
/// Sends the current message
|
||||||
Future<void> sendMessage() async {
|
Future<void> sendMessage() async {
|
||||||
var text = messageInputController.text.trim();
|
var text = messageInputController.text.trim();
|
||||||
if (text.isEmpty && messageInputController.attachments.isEmpty) {
|
var attachments = messageInputController.attachments;
|
||||||
|
|
||||||
|
if (text.isEmpty && attachments.isEmpty) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1561,7 +1563,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
if (widget.editMessage != null) {
|
if (widget.editMessage != null) {
|
||||||
message = widget.editMessage!.copyWith(
|
message = widget.editMessage!.copyWith(
|
||||||
text: text,
|
text: text,
|
||||||
attachments: messageInputController.attachments,
|
attachments: attachments,
|
||||||
mentionedUsers: messageInputController.mentionedUsers
|
mentionedUsers: messageInputController.mentionedUsers
|
||||||
.where((u) => text.contains('@${u.name}'))
|
.where((u) => text.contains('@${u.name}'))
|
||||||
.toList(),
|
.toList(),
|
||||||
@@ -1570,7 +1572,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
message = (widget.initialMessage ?? Message()).copyWith(
|
message = (widget.initialMessage ?? Message()).copyWith(
|
||||||
parentId: widget.parentMessage?.id,
|
parentId: widget.parentMessage?.id,
|
||||||
text: text,
|
text: text,
|
||||||
attachments: messageInputController.attachments,
|
attachments: attachments,
|
||||||
mentionedUsers: messageInputController.mentionedUsers
|
mentionedUsers: messageInputController.mentionedUsers
|
||||||
.where((u) => text.contains('@${u.name}'))
|
.where((u) => text.contains('@${u.name}'))
|
||||||
.toList(),
|
.toList(),
|
||||||
|
|||||||
Reference in New Issue
Block a user