mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
dont show ui before initial sync
This commit is contained in:
parent
8f09fdbc79
commit
818cf8051c
@ -54,14 +54,19 @@ export default async function main(label, button, container) {
|
||||
await session.setLoginData(loginData);
|
||||
}
|
||||
await session.load();
|
||||
showSession(container, session);
|
||||
const hsApi = new HomeServerApi(HOMESERVER, session.accessToken);
|
||||
console.log("session loaded");
|
||||
if (!session.syncToken) {
|
||||
const needsInitialSync = !session.syncToken;
|
||||
if (needsInitialSync) {
|
||||
console.log("session needs initial sync");
|
||||
} else {
|
||||
showSession(container, session);
|
||||
}
|
||||
const sync = new Sync(hsApi, session, storage);
|
||||
await sync.start();
|
||||
if (needsInitialSync) {
|
||||
showSession(container, session);
|
||||
}
|
||||
label.innerText = "sync running";
|
||||
button.addEventListener("click", () => sync.stop());
|
||||
sync.on("error", err => {
|
||||
|
Loading…
Reference in New Issue
Block a user