mirror of
https://github.com/morpheusthewhite/spicetify-themes.git
synced 2024-11-25 12:22:32 +01:00
fix(Turntable): fad-heart sometimes incorrect
This commit is contained in:
parent
fc78c50ab5
commit
f2ef742cde
@ -247,20 +247,29 @@ window.addEventListener("load", rotateTurntable = () => {
|
|||||||
|
|
||||||
const nowPlayingBarLeft = document.querySelector(".main-nowPlayingBar-left");
|
const nowPlayingBarLeft = document.querySelector(".main-nowPlayingBar-left");
|
||||||
const heartHiddenObserver = new MutationObserver(mutationsList => {
|
const heartHiddenObserver = new MutationObserver(mutationsList => {
|
||||||
const targetMutation = mutationsList[mutationsList.length - 1];
|
mutationsLoop:
|
||||||
|
for (const mutation of mutationsList) {
|
||||||
for (const addedNode of targetMutation.addedNodes) {
|
for (const addedNode of mutation.addedNodes) {
|
||||||
if (
|
if (
|
||||||
addedNode.matches('svg[class]')
|
addedNode.matches('svg[class]')
|
||||||
||
|
||
|
||||||
addedNode.matches('button[class^="main-addButton-button"]')
|
addedNode.matches('button[class^="main-addButton-button"]')
|
||||||
) handleFadHeart();
|
) {
|
||||||
|
handleFadHeart();
|
||||||
|
|
||||||
|
break mutationsLoop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const removedNode of targetMutation.removedNodes) {
|
for (const removedNode of mutation.removedNodes) {
|
||||||
if (
|
if (
|
||||||
removedNode.matches('button[class^="main-addButton-button"]')
|
removedNode.matches('button[class^="main-addButton-button"]')
|
||||||
) handleFadHeart();
|
) {
|
||||||
|
handleFadHeart();
|
||||||
|
|
||||||
|
break mutationsLoop;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
heartHiddenObserver.observe(nowPlayingBarLeft, {
|
heartHiddenObserver.observe(nowPlayingBarLeft, {
|
||||||
|
Loading…
Reference in New Issue
Block a user