mirror of
https://github.com/Afilmory/afilmory
synced 2026-02-01 14:44:48 +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
|
||||
}
|
||||
if (longPressTimerRef.current) {
|
||||
clearTimeout(longPressTimerRef.current)
|
||||
}
|
||||
longPressTimerRef.current = setTimeout(playVideo, 200)
|
||||
}, [isLivePhoto, isLivePhotoPlaying])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user