allow sending messages without a body if they have an attachment

This commit is contained in:
Henry Hiles 2026-07-21 20:27:21 -04:00
commit a8726feef6
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -56,8 +56,10 @@ class Composer extends HookConsumerWidget {
};
}
final attachment = ref.watch(AttachmentController.provider(roomId));
void send() {
if (controller.value.text.isEmpty) return;
if (controller.value.text.isEmpty && attachment == null) return;
onSend(
controller.value.formattedText,
shouldMention: shouldMention.value,
@ -73,8 +75,6 @@ class Composer extends HookConsumerWidget {
fontWeight: .bold,
);
final attachment = ref.watch(AttachmentController.provider(roomId));
return Padding(
padding: .all(12),
child: Column(