mirror of
https://github.com/morpheusthewhite/spicetify-themes.git
synced 2024-11-22 02:42:54 +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 heartHiddenObserver = new MutationObserver(mutationsList => {
|
||||
const targetMutation = mutationsList[mutationsList.length - 1];
|
||||
|
||||
for (const addedNode of targetMutation.addedNodes) {
|
||||
mutationsLoop:
|
||||
for (const mutation of mutationsList) {
|
||||
for (const addedNode of mutation.addedNodes) {
|
||||
if (
|
||||
addedNode.matches('svg[class]')
|
||||
||
|
||||
addedNode.matches('button[class^="main-addButton-button"]')
|
||||
) handleFadHeart();
|
||||
) {
|
||||
handleFadHeart();
|
||||
|
||||
break mutationsLoop;
|
||||
}
|
||||
}
|
||||
|
||||
for (const removedNode of targetMutation.removedNodes) {
|
||||
for (const removedNode of mutation.removedNodes) {
|
||||
if (
|
||||
removedNode.matches('button[class^="main-addButton-button"]')
|
||||
) handleFadHeart();
|
||||
) {
|
||||
handleFadHeart();
|
||||
|
||||
break mutationsLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
heartHiddenObserver.observe(nowPlayingBarLeft, {
|
||||
|
Loading…
Reference in New Issue
Block a user