fix(reels): auto-scroll advances photo reels after 5s
Photo posts have no onEnded event (video-only), so auto-scroll never advanced past them. Added a 5s timer (isActive && autoScrollEnabled && type !== "video") calling onRequestNext, mirroring the video's onEnded. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -156,6 +156,14 @@ export default function ReelsPostCard({
|
||||
const playbackSpeed = exploreUi ? exploreUi.playbackSpeed : 1;
|
||||
const allowSave = postData.author_allow_save !== false;
|
||||
|
||||
// عکس onEnded نداره (فقط ویدیو) — با پیمایش خودکار فعال، بعد از ۵ ثانیه خودش میره
|
||||
// ریلز بعدی؛ اگه این پست ویدیوعه این تایمر کاری نمیکنه (onEnded خودِ ویدیو مسئوله)
|
||||
useEffect(() => {
|
||||
if (!isActive || !autoScrollEnabled || type === "video") return;
|
||||
const timer = window.setTimeout(() => onRequestNext?.(), 5000);
|
||||
return () => window.clearTimeout(timer);
|
||||
}, [isActive, autoScrollEnabled, type, onRequestNext]);
|
||||
|
||||
const useCommentsSheet = !postPage;
|
||||
const anyCommentsOpen = commentsOpen || commentsModalOpen;
|
||||
const showLongVideoBar =
|
||||
|
||||
Reference in New Issue
Block a user