forked from Nexus/nexus
move attachment sending check to be earlier
fixes sending with keyboard before attachment uploaded
This commit is contained in:
parent
f0f426a647
commit
d7f49568a7
2 changed files with 7 additions and 6 deletions
|
|
@ -125,11 +125,9 @@ class RoomChatController extends AsyncNotifier<IList<Event>?> {
|
|||
if (relationType == .edit) {
|
||||
baseContent = relation?.content;
|
||||
} else {
|
||||
final attachment = ref.watch(AttachmentController.provider(roomId));
|
||||
if (attachment != null && attachment.$2 == null) return;
|
||||
|
||||
baseContent = attachment?.$2;
|
||||
ref.invalidate(AttachmentController.provider(roomId));
|
||||
final provider = AttachmentController.provider(roomId);
|
||||
baseContent = ref.watch(provider)?.$2;
|
||||
ref.invalidate(provider);
|
||||
}
|
||||
|
||||
var taggedMessage = text;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,10 @@ class Composer extends HookConsumerWidget {
|
|||
final attachment = ref.watch(AttachmentController.provider(roomId));
|
||||
|
||||
void send() {
|
||||
if (controller.value.text.isEmpty && attachment == null) return;
|
||||
if (controller.value.text.isEmpty && attachment == null ||
|
||||
attachment != null && attachment.$2 == null) {
|
||||
return;
|
||||
}
|
||||
onSend(
|
||||
controller.value.formattedText,
|
||||
shouldMention: shouldMention.value,
|
||||
|
|
|
|||
Loading…
Reference in a new issue