From 6540e3f774d01657f0cac359310cd827dafc7c07 Mon Sep 17 00:00:00 2001 From: qorexdev Date: Sat, 28 Mar 2026 15:28:50 +0500 Subject: [PATCH] refactor: wrap onAnimationEnd in useCallback for stable reference --- surfsense_web/components/onboarding-tour.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/surfsense_web/components/onboarding-tour.tsx b/surfsense_web/components/onboarding-tour.tsx index e097c212d..4204928ce 100644 --- a/surfsense_web/components/onboarding-tour.tsx +++ b/surfsense_web/components/onboarding-tour.tsx @@ -695,6 +695,10 @@ export function OnboardingTour() { setIsActive(false); }, [user?.id]); + const handleAnimationEnd = useCallback(() => { + setShouldAnimate(false); + }, []); + // Handle escape key useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { @@ -767,7 +771,7 @@ export function OnboardingTour() { onSkip={handleSkip} isDarkMode={isDarkMode} shouldAnimate={shouldAnimate} - onAnimationEnd={() => setShouldAnimate(false)} + onAnimationEnd={handleAnimationEnd} /> )}