From ceed41b60c484a76dcaa5129ee79e84ebe21ebc6 Mon Sep 17 00:00:00 2001 From: pdelfan Date: Fri, 16 Oct 2026 22:36:10 -0700 Subject: [PATCH] The composer decides whether a message can be sent once, as canSend, which both disables Send and stops a submit, so a new reason not to send can't reach one and miss the other. Submitting still checks on its own for a send already on its way and for a running reply, whose Stop takes Send's place. --- .../src/features/conversation/components/Composer.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/src/features/conversation/components/Composer.tsx b/apps/web/src/features/conversation/components/Composer.tsx index a3fc27f..cfcfdd4 100644 --- a/apps/web/src/features/conversation/components/Composer.tsx +++ b/apps/web/src/features/conversation/components/Composer.tsx @@ -150,8 +150,7 @@ export function Composer({ ref, ...props }: ComposerProps) { // runs there is nothing finished to answer. The cache knows of a send at once, before the // composer rerenders, so a second Enter right after the first is caught too. const onItsWay = queryClient.isMutating({ mutationKey: sendKey }) > 0 - if (onItsWay || props.onStop || props.waiting || blocked || attachments.uploading || empty) - return + if (!canSend || onItsWay || props.onStop) return attachments.clearError() sending.mutate(value) }, @@ -186,6 +185,9 @@ export function Composer({ ref, ...props }: ComposerProps) { const blocked = noModels || needsModel // Nothing to send: no text but spaces, no quotes, and no attachments. const empty = !hasText && quotes.length === 0 && attachments.attachments.length === 0 + // Send is disabled, and submitting does nothing, for the same reasons, so a new reason not to + // send goes here rather than in either alone. + const canSend = !(empty || blocked || props.waiting || attachments.uploading || sending.isPending) const { data: types, error: typesError } = useQuery(attachmentTypesQuery) const accept = types && acceptedTypes(types, seesImages) @@ -371,9 +373,7 @@ export function Composer({ ref, ...props }: ComposerProps) { ) : ( )} -- knotmirror 0.0.1