new-codigoparallevar/wait_for_update.js

20 lines
470 B
JavaScript
Raw Normal View History

(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();
})();