Commit 93d190a2 authored by Tasso Evangelista's avatar Tasso Evangelista

Update loading error page

parent 6308fe83
......@@ -17,3 +17,4 @@ setupSidebarPreload();
setupSpellcheckingPreload();
window.reloadServer = () => ipcRenderer.sendToHost('reload-server');
window.i18n = require('./i18n');
......@@ -5,7 +5,7 @@
<title>Server Failed to Load</title>
<link rel="stylesheet" type="text/css" href="../stylesheets/main.css">
<script>
document.addEventListener('DOMContentLoaded', () => {
window.addEventListener('load', () => {
document.title = i18n.__('Server_Failed_to_Load');
document.querySelector('.title').innerHTML = i18n.__('Houston_we_have_a_problem');
document.querySelector('.subtitle').innerHTML = i18n.__('Server_Failed_to_Load');
......@@ -13,22 +13,20 @@
document.querySelector('.reload-button').addEventListener('click', ({ target }) => {
document.querySelector('.reload-button').classList.add('hidden');
document.querySelector('.reloading-server').classList.remove('hidden');
// location.reload(true);
window.reloadServer();
}, false);
}, false);
document.addEventListener("DOMContentLoaded", () => {
let counter = 60;
const reloadCounterStepSize = 1;
const textBefore = document.querySelector(".reload-button").innerHTML + "";
const textBefore = document.querySelector('.reload-button').innerHTML;
setInterval(() => {
counter = counter - reloadCounterStepSize;
document.querySelector(".reload-button").innerHTML = `${textBefore} (${counter})`;
document.querySelector('.reload-button').innerHTML = `${textBefore} (${counter})`;
if (counter <= 0) {
document.querySelector(".reload-button").click();
document.querySelector('.reload-button').click();
}
}, reloadCounterStepSize * 1000);
}, false);
});
</script>
</head>
<body class="loading-error-page">
......
......@@ -4,7 +4,7 @@
align-items: center;
justify-content: center;
min-height: 100vh;
background-image: url('../public/images/error.jpg');
background-image: url('../public/images/not-found.jpg');
background-color: @primary-background-color;
background-position: center bottom;
background-repeat: no-repeat;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment