Skip to content

Commit 4e3bddb

Browse files
fix(mobile): guard editing and sending during task navigation
1 parent 5ef628e commit 4e3bddb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/mobile/src/features/threads/NewTaskDraftScreen.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,7 @@ export function NewTaskDraftScreen(props: {
12211221
);
12221222

12231223
async function handleStart(): Promise<void> {
1224+
if (submitNavigationAction !== null) return;
12241225
if (voiceInput.blocksSubmission || pendingPastedTextAttachmentCountRef.current > 0) return;
12251226
const selectedProject = flow.selectedProject;
12261227
const draftKey = flow.draftKey;
@@ -1414,6 +1415,7 @@ export function NewTaskDraftScreen(props: {
14141415
isIncomingShareReady &&
14151416
!isImportingShare &&
14161417
!flow.submitting &&
1418+
submitNavigationAction === null &&
14171419
pendingPastedTextAttachmentCount === 0 &&
14181420
!voiceInput.blocksSubmission &&
14191421
!(flow.workspaceMode === "worktree" && !flow.selectedBranchName);
@@ -1459,7 +1461,9 @@ export function NewTaskDraftScreen(props: {
14591461
// Focusing is a user action, so presenting the form sheet has one motion.
14601462
autoFocus={false}
14611463
// Clipboard imports use the editor's read-only mode to retain keyboard focus.
1462-
editable={!isIncomingShareTransferPending && !flow.submitting}
1464+
editable={
1465+
!isIncomingShareTransferPending && !flow.submitting && submitNavigationAction === null
1466+
}
14631467
readOnly={voiceInput.freezesEditor}
14641468
multiline
14651469
scrollEnabled

0 commit comments

Comments
 (0)