mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-07-06 19:51:27 +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);
|
hookCoverChange(false);
|
||||||
|
|
||||||
(function Startup() {
|
// Check latest release
|
||||||
if (!Spicetify.showNotification) {
|
waitForElement([".main-userWidget-box"], ([userWidget]) => {
|
||||||
setTimeout(Startup, 300);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Check latest release
|
|
||||||
fetch("https://api.github.com/repos/JulienMaille/dribbblish-dynamic-theme/releases/latest")
|
fetch("https://api.github.com/repos/JulienMaille/dribbblish-dynamic-theme/releases/latest")
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
return response.json();
|
return response.json();
|
||||||
|
|
@ -664,13 +660,13 @@ hookCoverChange(false);
|
||||||
upd.innerText = `Theme UPD v${data.tag_name} avail.`;
|
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();
|
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);
|
userWidget.append(upd);
|
||||||
document.querySelector(".main-userWidget-box").classList.add("update-avail");
|
userWidget.classList.add("update-avail");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
// Do something for an error here
|
// Do something for an error here
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
})();
|
});
|
||||||
|
|
||||||
$("html").css("--warning_message", " ");
|
$("html").css("--warning_message", " ");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue