diff --git a/surfsense_web/components/onboarding-tour.tsx b/surfsense_web/components/onboarding-tour.tsx index 03fad87b6..e097c212d 100644 --- a/surfsense_web/components/onboarding-tour.tsx +++ b/surfsense_web/components/onboarding-tour.tsx @@ -160,6 +160,8 @@ function TourTooltip({ onPrev, onSkip, isDarkMode, + shouldAnimate, + onAnimationEnd, }: { step: TourStep; stepIndex: number; @@ -170,23 +172,12 @@ function TourTooltip({ onPrev: () => void; onSkip: () => void; isDarkMode: boolean; + shouldAnimate: boolean; + onAnimationEnd: () => void; }) { - const [contentKey, setContentKey] = useState(stepIndex); - const [shouldAnimate, setShouldAnimate] = useState(false); - const prevStepIndexRef = useRef(stepIndex); const isLastStep = stepIndex === totalSteps - 1; const isFirstStep = stepIndex === 0; - // Update content key when step changes to trigger animation - // Only animate if stepIndex actually changes (not on initial mount) - useEffect(() => { - if (prevStepIndexRef.current !== stepIndex) { - setShouldAnimate(true); - setContentKey(stepIndex); - prevStepIndexRef.current = stepIndex; - } - }, [stepIndex]); - const bgColor = isDarkMode ? "#27272a" : "#ffffff"; const textColor = isDarkMode ? "#ffffff" : "#18181b"; const mutedTextColor = isDarkMode ? "#a1a1aa" : "#71717a"; @@ -358,11 +349,11 @@ function TourTooltip({ > {/* Content */}