mirror of
https://github.com/meowarex/TidaLuna-Plugins.git
synced 2026-06-18 03:43:10 +10:00
Merge pull request #94 from meowarex/player-market-ui-rewrite
Fixed UI Freeze on Tidal line fallback
This commit is contained in:
@@ -3249,15 +3249,20 @@ const startTidalFollowLoop = (): void => {
|
|||||||
const lyricsContainer = findLyricsContainer();
|
const lyricsContainer = findLyricsContainer();
|
||||||
if (!lyricsContainer) return;
|
if (!lyricsContainer) return;
|
||||||
|
|
||||||
|
const tidalSpans = lyricsContainer.querySelectorAll(
|
||||||
|
'span[data-test="lyrics-line"]',
|
||||||
|
);
|
||||||
|
if (tidalSpans.length === 0) return;
|
||||||
|
|
||||||
tidalFollowObserver = new MutationObserver(() => {
|
tidalFollowObserver = new MutationObserver(() => {
|
||||||
updateTidalFollowActiveLine();
|
updateTidalFollowActiveLine();
|
||||||
});
|
});
|
||||||
tidalFollowObserver.observe(lyricsContainer, {
|
for (const span of tidalSpans) {
|
||||||
subtree: true,
|
tidalFollowObserver.observe(span, {
|
||||||
childList: true,
|
attributes: true,
|
||||||
attributes: true,
|
attributeFilter: ["class"],
|
||||||
attributeFilter: ["class"],
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
updateTidalFollowActiveLine();
|
updateTidalFollowActiveLine();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user