From 35009d30f0bb996e7d0e957b08079ff822fa12c5 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 31 May 2026 08:50:11 -0700 Subject: [PATCH] perf: move mobile task copy cleanup to root ref --- mobile/app/h/[hostId]/tasks.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mobile/app/h/[hostId]/tasks.tsx b/mobile/app/h/[hostId]/tasks.tsx index 7e2108b6a77..f0c4620bf9f 100644 --- a/mobile/app/h/[hostId]/tasks.tsx +++ b/mobile/app/h/[hostId]/tasks.tsx @@ -3759,8 +3759,13 @@ export default function MobileTasksScreen() { return () => clearTimeout(timer) }, [githubKind, provider, query, taskStateHydrated]) - useEffect(() => { - return () => clearMobileTaskCopyFeedbackTimer(copiedLinkResetTimerRef) + const setTaskCopyFeedbackRootRef = useCallback((node: View | null): void => { + if (node !== null) { + return + } + // Why: copied-link feedback is screen-local; clear the pending reset when + // the Tasks screen detaches without a passive cleanup-only Effect. + clearMobileTaskCopyFeedbackTimer(copiedLinkResetTimerRef) }, []) useEffect(() => { @@ -8244,7 +8249,7 @@ export default function MobileTasksScreen() { return ( - + router.back()}>