mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-17 18:35:19 +02:00
refactor: wrap onAnimationEnd in useCallback for stable reference
This commit is contained in:
parent
3b33a3efdb
commit
6540e3f774
1 changed files with 5 additions and 1 deletions
|
|
@ -695,6 +695,10 @@ export function OnboardingTour() {
|
||||||
setIsActive(false);
|
setIsActive(false);
|
||||||
}, [user?.id]);
|
}, [user?.id]);
|
||||||
|
|
||||||
|
const handleAnimationEnd = useCallback(() => {
|
||||||
|
setShouldAnimate(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
// Handle escape key
|
// Handle escape key
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (e: KeyboardEvent) => {
|
const handleKeyDown = (e: KeyboardEvent) => {
|
||||||
|
|
@ -767,7 +771,7 @@ export function OnboardingTour() {
|
||||||
onSkip={handleSkip}
|
onSkip={handleSkip}
|
||||||
isDarkMode={isDarkMode}
|
isDarkMode={isDarkMode}
|
||||||
shouldAnimate={shouldAnimate}
|
shouldAnimate={shouldAnimate}
|
||||||
onAnimationEnd={() => setShouldAnimate(false)}
|
onAnimationEnd={handleAnimationEnd}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue