| @@ -1,6 +1,6 @@ | |||
| { | |||
| "name": "pipic", | |||
| "version": "1.0.0", | |||
| "version": "1.0.1", | |||
| "description": "Pipic is software for making slideshows. The idea is that you have one server, running a pipic server, and have as many clients as necessary which just display the website hosted by the pipic server.", | |||
| "main": "server.js", | |||
| "dependencies": { | |||
| @@ -36,10 +36,13 @@ function update(name) { | |||
| } | |||
| function reload() { | |||
| message("Server down, waiting"); | |||
| message("Connection to server lost."); | |||
| var i = setInterval(() => { | |||
| fetch("/") | |||
| .then(() => { | |||
| .then(res => { | |||
| if (res.status !== 200) | |||
| return; | |||
| history.replaceState({}, "", "/"); | |||
| location.reload(); | |||
| }) | |||
| @@ -61,7 +64,7 @@ function await() { | |||
| } | |||
| await(); | |||
| }) | |||
| .catch(err => { console.error(err); await(); }); | |||
| .catch(err => { console.error(err); reload(); }); | |||
| } | |||
| await(); | |||