@@ -24,10 +24,7 @@ import { useAttachmentEditing } from "@/features/messages/lib/useAttachmentEditi
2424import { useMediaUpload } from "@/features/messages/lib/useMediaUpload" ;
2525import { useMentions } from "@/features/messages/lib/useMentions" ;
2626import { diffAddedMentionPubkeys } from "@/features/messages/lib/threading" ;
27- import {
28- getPersistentAgentAudienceRevision ,
29- getPersistentAgentAudienceScope ,
30- } from "@/features/messages/lib/persistentAgentAudience" ;
27+ import { getPersistentAgentAudienceScope } from "@/features/messages/lib/persistentAgentAudience" ;
3128import { useIdentityQuery } from "@/shared/api/hooks" ;
3229import {
3330 hasMentionClipboardHtml ,
@@ -292,7 +289,8 @@ function MessageComposerImpl({
292289 persistentMentionHydration ,
293290 ) ;
294291 persistentMentionHydrationRef . current = persistentMentionHydration ;
295- const { beginSubmit, endSubmit } = persistentMentionHydration ;
292+ const { beginSubmit, endSubmit, getAudienceRevision } =
293+ persistentMentionHydration ;
296294 const {
297295 audienceChips,
298296 composerAudienceHint,
@@ -616,12 +614,7 @@ function MessageComposerImpl({
616614 spoileredAttachmentUrls,
617615 trimmed,
618616 audienceGeneration,
619- // Snapshot the store revision at submit time. A chip removal may have
620- // happened in the current event turn, before React re-renders this
621- // composer; a later removal still advances the revision and wins.
622- audienceRevision : audienceScope
623- ? getPersistentAgentAudienceRevision ( audienceScope )
624- : null ,
617+ audienceRevision : getAudienceRevision ( ) ,
625618 } ) ;
626619 } finally {
627620 endSubmit ( ) ;
@@ -645,10 +638,10 @@ function MessageComposerImpl({
645638 syncComposerContentFromEditor ,
646639 onCaptureSendContext ,
647640 onPreparingMentionSendChange ,
648- audienceScope ,
649641 audienceGeneration ,
650642 beginSubmit ,
651643 endSubmit ,
644+ getAudienceRevision ,
652645 ] ) ;
653646 submitMessageRef . current = submitMessage ;
654647
0 commit comments