mirror of
https://github.com/Afilmory/afilmory
synced 2026-02-01 22:48:17 +00:00
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:
@@ -182,6 +182,9 @@ export const ProgressiveImage = ({
|
|||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (longPressTimerRef.current) {
|
||||||
|
clearTimeout(longPressTimerRef.current)
|
||||||
|
}
|
||||||
longPressTimerRef.current = setTimeout(playVideo, 200)
|
longPressTimerRef.current = setTimeout(playVideo, 200)
|
||||||
}, [isLivePhoto, isLivePhotoPlaying])
|
}, [isLivePhoto, isLivePhotoPlaying])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user