fix: possible fix for edge of episode issue

possible fix(untested) to fix an issue when exiting as next episode
countdown is active

Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com>
This commit is contained in:
Lance Chant
2026-05-27 07:32:48 +02:00
parent 796e12b4ac
commit f1c2b9de53
3 changed files with 13 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import {
View,
} from "react-native";
import Animated, {
cancelAnimation,
Easing,
runOnJS,
useAnimatedStyle,
@@ -45,6 +46,11 @@ const NextEpisodeCountDownButton: React.FC<NextEpisodeCountDownButtonProps> = ({
}
},
);
// Cancel animation on unmount to prevent onFinish from firing after exit
return () => {
cancelAnimation(progress);
};
}
}, [show, onFinish]);