Wait for login window to load before using it

This commit is contained in:
Yuri Iozzelli 2022-10-05 12:25:47 +02:00 committed by Carlo Piovesan
parent d3290c1cfe
commit 1d5e225fd4

View file

@ -91,16 +91,18 @@
window.networkInterface.listen = listen;
loginElem.style.cursor = "pointer";
statusElem.style.color = "white";
loginElem.onclick = async () => {
loginElem.onclick = () => {
loginElem.onclick = null;
statusElem.innerHTML = "Downloading network code...";
const w = window.open("login.html", "_blank");
w.onload = async () => {
await up();
w.document.body.innerHTML = "Starting login...";
statusElem.innerHTML = "Starting login...";
const url = await loginPromise;
w.location.href = url;
};
};
</script>
<script src="./xterm/xterm.js"></script>
<script src="./xterm/xterm-addon-fit.js"></script>