This commit is contained in:
Andras Bacsai
2023-04-28 11:54:01 +02:00
parent 2fb8d928e5
commit 321087cb6d
4 changed files with 31 additions and 9 deletions

View File

@@ -25,6 +25,25 @@
<x-confirm-modal />
@livewireScripts
@auth
<script>
Livewire.on('updateInitiated', () => {
let checkStatus = null;
console.log('Update initiated')
setInterval(async () => {
const res = await fetch('/api/health');
if (res.ok) {
console.log('Server is back online')
clearInterval(checkStatus);
window.location.reload();
} else {
console.log('Waiting for server to come back online...');
}
return;
}, 2000);
})
</script>
@endauth
</body>
</html>