new-codigoparallevar/wait_for_update.js
2022-07-21 21:19:03 +02:00

20 lines
470 B
JavaScript

(function (){
var wait_for_update = function() {
console.debug("Waiting for changes...");
fetch('/__wait_for_changes').then(r => {
if (r.status !== 200) {
setTimeout(
wait_for_update,
1000,
);
}
else {
// Reload
window.location = window.location;
}
});
};
wait_for_update();
})();