From 57a8b42154d9e42a949cb4c42420b5139a17e0a1 Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Wed, 5 Oct 2022 13:52:14 +0200 Subject: [PATCH] Simplify logic on new page load --- index.html | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index b1f4749..440f3f7 100644 --- a/index.html +++ b/index.html @@ -96,13 +96,12 @@ 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; - }; + async function waitLogin() { + await up(); + const url = await loginPromise; + w.location.href = url; + } + waitLogin(); };