mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 04:08:32 +03:00
parent
0feee7ea93
commit
e32c6c6473
1 changed files with 1 additions and 3 deletions
|
@ -1272,9 +1272,8 @@ function Carousel({ mediaAttachments, index = 0, onClose = () => {} }) {
|
|||
const [showControls, setShowControls] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
let swipeTimeout;
|
||||
let handleSwipe = () => {
|
||||
swipeTimeout = setTimeout(onClose, 500);
|
||||
onClose();
|
||||
};
|
||||
if (carouselRef.current) {
|
||||
carouselRef.current.addEventListener('swiped-down', handleSwipe);
|
||||
|
@ -1283,7 +1282,6 @@ function Carousel({ mediaAttachments, index = 0, onClose = () => {} }) {
|
|||
if (carouselRef.current) {
|
||||
carouselRef.current.removeEventListener('swiped-down', handleSwipe);
|
||||
}
|
||||
clearTimeout(swipeTimeout);
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue