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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user