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:
2026-07-28 09:20:31 +07:00
parent 2f2f84066c
commit 5d31563df6
3 changed files with 10 additions and 2 deletions
+2
View File
@@ -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;