From f6e167bd04e37779ba128095b2e60c04c8cfeac6 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 20 Jul 2025 10:43:19 -0500 Subject: [PATCH] Debug linkwithstatus cleanup --- src/components/LinkWithStatus.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/LinkWithStatus.tsx b/src/components/LinkWithStatus.tsx index 578e0165..923dfdfa 100644 --- a/src/components/LinkWithStatus.tsx +++ b/src/components/LinkWithStatus.tsx @@ -35,16 +35,16 @@ export default function LinkWithStatus({ if (isLoading) { console.log('link: 02', {isLoading, ref: didStartLoading.current}); didStartLoading.current = true; - return () => { - // Call onload when component unmounts while loading - console.log('link: 03', {isLoading, ref: didStartLoading.current}); - if (isLoading) { onLoad?.(); } - }; } else if (didStartLoading.current) { console.log('link: 04', {isLoading, ref: didStartLoading.current}); onLoad?.(); didStartLoading.current = false; } + return () => { + // Call onload when component unmounts while loading + console.log('link: 03', {isLoading, ref: didStartLoading.current}); + if (isLoading) { onLoad?.(); } + }; }, [isLoading, onLoad]); return