1
0
forked from mirrors/0ad

Close register-page before opening login-page

The `onTick` of the register-page was still running when connecting to
the lobby. This lead to an error when the `connect` message was
received.
With this commit returning from the login-page will always return to the
entrance-page. Previously it returned to the register-page when it was
opened by through that page.
This commit is contained in:
phosit
2025-12-30 18:23:43 +01:00
parent bc021863af
commit 0b83e24065
3 changed files with 6 additions and 4 deletions
@@ -42,4 +42,6 @@ async function cancelButton()
await new Promise(resolve => { Engine.GetGUIObjectByName("cancel").onPress = resolve; });
if (Engine.HasXmppClient())
Engine.StopXmppClient();
return false;
}
@@ -13,7 +13,8 @@ function loginButton()
Engine.OpenChildPage("page_prelobby_login.xml");
}
function registerButton()
async function registerButton()
{
Engine.OpenChildPage("page_prelobby_register.xml");
if (await Engine.OpenChildPage("page_prelobby_register.xml"))
Engine.OpenChildPage("page_prelobby_login.xml");
}
@@ -40,6 +40,5 @@ async function onRegistered()
setFeedback(translate("Registered"));
Engine.StopXmppClient();
Engine.OpenChildPage("page_prelobby_login.xml");
return true;
}