fix: playhead not moving in SECTION-TAB with empty tracks
Two fixes: 1. handlePlayPause: add explicit requestAnimationFrame(updatePlayhead) after setIsPlaying(true) to ensure RAF starts immediately. 2. handleEditSectionInTab: add setCurrentTime(0) to reset playhead to section start. Without this, currentTime may be outside the section's timeline range (e.g. from main session playback).
This commit is contained in:
@@ -8525,6 +8525,7 @@ const App = () => {
|
||||
}));
|
||||
setSessionTabs(prev => [...prev, { id: tabId, name: tabName, sectionId: sectionId, tracks: clonedTracks, color: section.color || null }]);
|
||||
setActiveTab(tabId);
|
||||
setCurrentTime(0);
|
||||
};
|
||||
|
||||
// ── Sub Tab: apply effects & merge back (LOOP_EDITOR_2.md §1.2) ──
|
||||
@@ -10614,6 +10615,7 @@ const App = () => {
|
||||
startAudioTimeRef.current = context.currentTime;
|
||||
startTrackPlayback(currentTime);
|
||||
setIsPlaying(true);
|
||||
animationFrameIdRef.current = requestAnimationFrame(updatePlayhead);
|
||||
}
|
||||
};
|
||||
handlePlayPauseRef.current = handlePlayPause;
|
||||
|
||||
Reference in New Issue
Block a user