authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-12 18:15:05-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-12 18:15:05-07:00
logaf0657e3b36d8fc9d2652e83e6e9032272629631
tree226cc4518a12826e80c1749d3e29ed79d93b3145
parent5781e2be2b7d079faaf677cc1b39679e9850d833
signature Signed by PGP key B5690EEEBB952194

fix(mobile): stop alerting that shared content vanished after sending it (#11487)

Co-authored-by: Claude Code <noreply@anthropic.com>

1 files changed, 9 insertions(+), 2 deletions(-)

apps/mobile/src/features/threads/NewTaskDraftScreen.tsx+9-2
...@@ -323,6 +323,11 @@ export function NewTaskDraftScreen(props: {...@@ -323,6 +323,11 @@ export function NewTaskDraftScreen(props: {
323 latestIncomingShareIdRef.current = props.incomingShareId;323 latestIncomingShareIdRef.current = props.incomingShareId;
324 const isImportingShare = importingShareKey !== null;324 const isImportingShare = importingShareKey !== null;
325 const alertedUnavailableIncomingShareIdRef = useRef<string | null>(null);325 const alertedUnavailableIncomingShareIdRef = useRef<string | null>(null);
326 // The share this screen already moved into its draft. Sending clears the
327 // draft (and its importedShareIds receipt) a frame before the screen leaves,
328 // and the inbox entry is long gone by then; without this the re-render in
329 // between reads as "shared content vanished" and alerts on every send.
330 const consumedIncomingShareIdRef = useRef<string | null>(null);
326 const incomingShare = props.incomingShareId ? getShare(props.incomingShareId) : null;331 const incomingShare = props.incomingShareId ? getShare(props.incomingShareId) : null;
327 const requestedInitialProjectAvailable = Boolean(332 const requestedInitialProjectAvailable = Boolean(
328 props.initialProjectRef?.environmentId &&333 props.initialProjectRef?.environmentId &&
...@@ -416,8 +421,9 @@ export function NewTaskDraftScreen(props: {...@@ -416,8 +421,9 @@ export function NewTaskDraftScreen(props: {
416 }, [navigation, preventRemove, submitNavigationAction]);421 }, [navigation, preventRemove, submitNavigationAction]);
417 const hasImportedIncomingShare = Boolean(422 const hasImportedIncomingShare = Boolean(
418 props.incomingShareId &&423 props.incomingShareId &&
419 flow.draftKey &&424 (consumedIncomingShareIdRef.current === props.incomingShareId ||
420 getComposerDraftSnapshot(flow.draftKey).importedShareIds?.includes(props.incomingShareId),425 (flow.draftKey &&
426 getComposerDraftSnapshot(flow.draftKey).importedShareIds?.includes(props.incomingShareId))),
421 );427 );
422 const isIncomingShareUnavailable = Boolean(428 const isIncomingShareUnavailable = Boolean(
423 props.incomingShareId &&429 props.incomingShareId &&
...@@ -747,6 +753,7 @@ export function NewTaskDraftScreen(props: {...@@ -747,6 +753,7 @@ export function NewTaskDraftScreen(props: {
747 }753 }
748 await consumeShare(shareId);754 await consumeShare(shareId);
749 didConsumeShare = true;755 didConsumeShare = true;
756 consumedIncomingShareIdRef.current = shareId;
750 // The consumed inbox draft was the last owner of files that never made757 // The consumed inbox draft was the last owner of files that never made
751 // it into the composer draft (unsupported server, oversize, limit758 // it into the composer draft (unsupported server, oversize, limit
752 // skips). Release them before any early return: an unmount or a759 // skips). Release them before any early return: an unmount or a