Web socket + fill setup

This commit is contained in:
Asher
2019-01-14 17:19:29 -06:00
committed by Kyle Carberry
parent 14f91686c5
commit 24a86b81ba
12 changed files with 64 additions and 65 deletions

View File

@@ -3,7 +3,7 @@ import { load } from "@coder/vscode";
import "./index.scss";
const loadTime = time(2500);
logger.info("Loading IDE...");
logger.info("Loading IDE");
const overlay = document.getElementById("overlay");
const logo = document.getElementById("logo");
@@ -33,11 +33,15 @@ load().then(() => {
overlay.classList.add("error");
}
if (msgElement) {
msgElement.innerText = `Failed to load: ${error.message}. Retrying in 3 seconds...`;
const button = document.createElement("div");
button.className = "reload-button";
button.innerText = "Reload";
button.addEventListener("click", () => {
location.reload();
});
msgElement.innerText = `Failed to load: ${error.message}.`;
msgElement.parentElement!.appendChild(button);
}
setTimeout(() => {
location.reload();
}, 3000);
}).finally(() => {
logger.info("Load completed", field("duration", loadTime));
});