Persist lyrics queries in indexeddb

This commit is contained in:
jeffvli 2023-08-04 01:41:45 -07:00
parent adfa748bfb
commit ee83fdba71
6 changed files with 138 additions and 32 deletions

View file

@ -146,7 +146,7 @@ export const SynchronizedLyrics = ({
'sychronized-lyrics-scroll-container',
) as HTMLElement;
const currentLyric = document.querySelector(`#lyric-${index}`) as HTMLElement;
const offsetTop = currentLyric?.offsetTop - doc?.clientHeight / 2 ?? 0;
const offsetTop = currentLyric.offsetTop - doc.clientHeight / 2 ?? 0;
if (currentLyric === null) {
lyricRef.current = undefined;