mirror of
https://github.com/matrix-construct/construct
synced 2025-02-19 18:20:19 +01:00
client: Fixes to client.
This commit is contained in:
parent
a901256bcc
commit
b18413e0ed
3 changed files with 13 additions and 14 deletions
modules/static
|
@ -156,7 +156,6 @@ mc.auth["m.register.user"] = async function(opts = {})
|
|||
mc.session.guest = false;
|
||||
mc.instance.authentic = true;
|
||||
Object.update(mc.session, data);
|
||||
mc.run();
|
||||
return true;
|
||||
}
|
||||
catch(error)
|
||||
|
|
|
@ -32,18 +32,18 @@
|
|||
|
||||
/**
|
||||
* Main synchronous loop. This drives the client by receiving updates from
|
||||
* /sync or tries to figure out why it can't, fix it, and then continue to
|
||||
* /sync or tries to figure out why it can't, fix it, and then continues to
|
||||
* poll /sync. Otherwise if there is no hope that /sync can ever be called,
|
||||
* the client is cleanly shut down and the function returns. Any exceptions
|
||||
* out of here are abnormal and the window should be reloaded.
|
||||
* the client is cleanly shut down and the function returns. Call mc.run()
|
||||
* after this happens.
|
||||
*
|
||||
* Any exceptions out of here are abnormal and the window should be reloaded.
|
||||
*/
|
||||
mc.main = async function()
|
||||
{
|
||||
var ret = 0;
|
||||
let sopts = {};
|
||||
await mc.main.init();
|
||||
|
||||
while(1) try
|
||||
if(await mc.main.init()) while(1) try
|
||||
{
|
||||
// longpolls and processes data from a /sync request
|
||||
mc.ng.apply.later();
|
||||
|
@ -83,17 +83,17 @@ mc.main.init = async function()
|
|||
mc.settings.init();
|
||||
mc.console.init();
|
||||
|
||||
// Fault this manually to ensure authenticity for now.
|
||||
console.log("Logging in...");
|
||||
let errors = {};
|
||||
await mc.main.fault["M_MISSING_TOKEN"](errors);
|
||||
|
||||
// This event will break the main loop and allow a clean shutdown.
|
||||
window.addEventListener("beforeunload", mc.main.beforeunload,
|
||||
{
|
||||
passive: false,
|
||||
once: true,
|
||||
});
|
||||
|
||||
// Fault this manually to ensure authenticity for now.
|
||||
console.log("Logging in...");
|
||||
let errors = {};
|
||||
return await mc.main.fault["M_MISSING_TOKEN"](errors);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -1084,7 +1084,7 @@ type="text/ng-template"
|
|||
name="login_"
|
||||
type="submit"
|
||||
class="submit button"
|
||||
ng-click="mc.auth['m.login.password'](); $event.stopPropagation();"
|
||||
ng-click="mc.auth['m.login.password'](); mc.run(); $event.stopPropagation();"
|
||||
>
|
||||
LOGIN
|
||||
</button>
|
||||
|
@ -1096,7 +1096,7 @@ type="text/ng-template"
|
|||
{
|
||||
disabled: mc.auth['m.register.user'].disabled,
|
||||
}"
|
||||
ng-click="mc.auth['m.register.user'](); $event.stopPropagation();"
|
||||
ng-click="mc.auth['m.register.user'](); mc.run(); $event.stopPropagation();"
|
||||
>
|
||||
REGISTER
|
||||
</button>
|
||||
|
|
Loading…
Add table
Reference in a new issue