Clock/update.js

21 lines
503 B
JavaScript
Raw Normal View History

2022-11-12 02:43:16 +00:00
function reqData(start) {
2022-09-14 14:44:56 +00:00
var donedata = (e) => {
var resp = e;
2022-09-13 15:57:56 +00:00
if (resp != prevSha) {
2022-11-12 02:43:16 +00:00
window.sessionStorage.setItem("commitsha", resp);
if (start) return;
2022-09-15 15:36:03 +00:00
document.querySelector("#updatesha").innerHTML = `from ${prevSha} to ${resp}`;
2022-11-12 02:43:16 +00:00
document.querySelector("#updatedialog").classList.add("open");
2022-09-13 15:57:56 +00:00
}
2022-09-14 14:44:56 +00:00
};
2022-09-13 15:57:56 +00:00
2022-09-14 14:44:56 +00:00
fetch("https://ClockCheckGithub.meowcatheorange.repl.co")
.then(x => x.text())
.then(y => donedata(y));
2022-09-13 15:57:56 +00:00
}
2022-11-12 02:43:16 +00:00
setInterval(reqData, 60000);
reqData(true);