1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +12:00

Update frontend

This commit is contained in:
Adria Navarro 2024-01-04 13:18:55 +01:00
parent 5dd3c7cada
commit 746178f169

View file

@ -4,6 +4,8 @@
const timeoutMs = 60000 // 1 minute
const loadTime = Date.now()
let timedOut = false
async function checkMigrationsFinished() {
setTimeout(async () => {
const response = await API.getMigrationStatus()
@ -11,7 +13,6 @@
if (loadTime + timeoutMs > Date.now()) {
return checkMigrationsFinished()
}
return migrationTimeout()
}
@ -22,16 +23,39 @@
checkMigrationsFinished()
function migrationTimeout() {
// TODO
alert("Something went wrong 💀")
timedOut = true
}
</script>
<div class="loading">Updating the system...</div>
<div class="loading">
{#if !timedOut}
<p class="loading-message">
🛠️ We are updating the system. <br />Please wait, we will be back in a
second!
</p>
{:else}
<p class="loading-message timeout">
An error occurred. Please try again later.
</p>
{/if}
</div>
<style>
.loading {
display: flex;
justify-content: center;
align-items: center;
justify-content: center;
flex-direction: column;
gap: var(--spacing-xl);
height: 100vh;
margin: 0;
}
.loading-message {
text-align: center;
font-size: 18px;
}
.timeout {
color: rgb(196, 46, 46);
}
</style>