Skip to content

Commit b786195

Browse files
committed
fix(mobile): confirm before stopping background work from the floating capsule
1 parent aaf4a90 commit b786195

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,19 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
763763
label: statusPending ? "Stopping..." : "Stop",
764764
accessibilityLabel: "Stop background work",
765765
disabled: !props.canOperateThread || statusPending,
766-
onPress: () => void runStatusAction("stop"),
766+
// Stop sits between the capsule's navigation targets, so a stray tap
767+
// must not end every background task.
768+
onPress: () =>
769+
Dialog.confirm({
770+
title: "Stop background work?",
771+
message:
772+
queuedCount > 0
773+
? `${pendingBackgroundWork.title}. Queued messages wait until you resume.`
774+
: pendingBackgroundWork.title,
775+
confirmText: "Stop",
776+
destructive: true,
777+
onConfirm: () => void runStatusAction("stop"),
778+
}),
767779
},
768780
};
769781
}

0 commit comments

Comments
 (0)