new-codigoparallevar/scripts/wait_for_update.js
2022-07-25 12:19:32 +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();
})();