mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-22 18:36:34 +02:00
fix pronunciation lyrics line not syncing on toggle (#2225)
This commit is contained in:
@@ -234,13 +234,10 @@ export const SynchronizedKaraokeLyrics = ({
|
|||||||
syncFromCurrentTimestamp();
|
syncFromCurrentTimestamp();
|
||||||
}, [offsetMs, syncFromCurrentTimestamp]);
|
}, [offsetMs, syncFromCurrentTimestamp]);
|
||||||
|
|
||||||
// Rebuild animation state when async romaji overlay data arrives after initial mount.
|
// Rebuild animation state when timed overlay DOM changes (pronunciation, translation,
|
||||||
// Without this, overlayParts stay empty until a pause/resume triggers rebuildLyricsData().
|
// async romaji, or extra overlays). Without this, overlayParts stay empty/stale until
|
||||||
|
// pause/resume triggers rebuildLyricsData().
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (syncedRomajiLyrics == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const frame = requestAnimationFrame(() => {
|
const frame = requestAnimationFrame(() => {
|
||||||
rebuildLyricsData();
|
rebuildLyricsData();
|
||||||
|
|
||||||
@@ -254,7 +251,15 @@ export const SynchronizedKaraokeLyrics = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
return () => cancelAnimationFrame(frame);
|
return () => cancelAnimationFrame(frame);
|
||||||
}, [delayMsRef, rebuildLyricsData, syncAtTime, syncedRomajiLyrics]);
|
}, [
|
||||||
|
delayMsRef,
|
||||||
|
extraOverlayLyrics,
|
||||||
|
pronunciationLyrics,
|
||||||
|
rebuildLyricsData,
|
||||||
|
syncAtTime,
|
||||||
|
syncedRomajiLyrics,
|
||||||
|
translationLyrics,
|
||||||
|
]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
statusRef.current = usePlayerStoreBase.getState().player.status;
|
statusRef.current = usePlayerStoreBase.getState().player.status;
|
||||||
|
|||||||
Reference in New Issue
Block a user