fix: clear long press timer in ProgressiveImage component

- Added logic to clear the long press timer when it is already set, preventing unintended video playback triggers.
- This change enhances the user experience by ensuring that the long press action behaves as expected.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-06-28 14:15:08 +08:00
parent 4b87e19ff3
commit a4eb754243

View File

@@ -182,6 +182,9 @@ export const ProgressiveImage = ({
) {
return
}
if (longPressTimerRef.current) {
clearTimeout(longPressTimerRef.current)
}
longPressTimerRef.current = setTimeout(playVideo, 200)
}, [isLivePhoto, isLivePhotoPlaying])