forked from mirrors/0ad
bf0034f694
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.
(cherry picked from commit 0b83e24065)
Signed-off-by: phosit <phosit@autistici.org>
21 lines
436 B
JavaScript
21 lines
436 B
JavaScript
function init()
|
|
{
|
|
if (Engine.ConfigDB_GetValue("user", "lobby.login"))
|
|
loginButton();
|
|
|
|
return new Promise(closePageCallback => {
|
|
Engine.GetGUIObjectByName("cancel").onPress = closePageCallback;
|
|
});
|
|
}
|
|
|
|
function loginButton()
|
|
{
|
|
Engine.OpenChildPage("page_prelobby_login.xml");
|
|
}
|
|
|
|
async function registerButton()
|
|
{
|
|
if (await Engine.OpenChildPage("page_prelobby_register.xml"))
|
|
Engine.OpenChildPage("page_prelobby_login.xml");
|
|
}
|