mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-06-20 15:11:14 +00:00
fix checking for update sometimes causing an error
This commit is contained in:
parent
60863b5464
commit
4ff04c543c
1 changed files with 5 additions and 9 deletions
|
|
@ -643,12 +643,8 @@ function hookCoverChange(pick) {
|
|||
|
||||
hookCoverChange(false);
|
||||
|
||||
(function Startup() {
|
||||
if (!Spicetify.showNotification) {
|
||||
setTimeout(Startup, 300);
|
||||
return;
|
||||
}
|
||||
// Check latest release
|
||||
// Check latest release
|
||||
waitForElement([".main-userWidget-box"], ([userWidget]) => {
|
||||
fetch("https://api.github.com/repos/JulienMaille/dribbblish-dynamic-theme/releases/latest")
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
|
|
@ -664,13 +660,13 @@ hookCoverChange(false);
|
|||
upd.innerText = `Theme UPD v${data.tag_name} avail.`;
|
||||
new Spicetify.Menu.Item("Update Dribbblish", false, () => window.open("https://github.com/JulienMaille/dribbblish-dynamic-theme/releases/latest", "_blank")).register();
|
||||
}
|
||||
document.querySelector(".main-userWidget-box").append(upd);
|
||||
document.querySelector(".main-userWidget-box").classList.add("update-avail");
|
||||
userWidget.append(upd);
|
||||
userWidget.classList.add("update-avail");
|
||||
})
|
||||
.catch((err) => {
|
||||
// Do something for an error here
|
||||
console.error(err);
|
||||
});
|
||||
})();
|
||||
});
|
||||
|
||||
$("html").css("--warning_message", " ");
|
||||
|
|
|
|||
Loading…
Reference in a new issue