fix(Turntable): automatically update the song preview when toggle the Shuffle in some scenes

- toggle the Shuffle in the Touch Bar
- Connect to a device
This commit is contained in:
Grason Chan 2021-10-29 23:48:28 +08:00
parent 7cfaf35d8d
commit adf523cc98

View File

@ -251,6 +251,14 @@ window.addEventListener("load", rotateTurntable = () => {
handleRotate("load");
const shuffleBtn = document.querySelector(".main-shuffleButton-button");
const shuffleObserver = new MutationObserver(() => {
setTimeout(handleTracksNamePreview, 500);
});
shuffleObserver.observe(shuffleBtn, {
attributes: true,
});
Spicetify.Player.addEventListener("onplaypause", () => handleRotate("playpause"));
Spicetify.Player.addEventListener("songchange", () => {
setTimeout(() => {