forked from mystiq/hydrogen-web
cleanup main logging
This commit is contained in:
parent
3438806781
commit
90b016bbcf
1 changed files with 4 additions and 2 deletions
|
@ -38,14 +38,16 @@ async function main() {
|
||||||
({sessionId, loginData} = await login(USERNAME, PASSWORD, HOMESERVER));
|
({sessionId, loginData} = await login(USERNAME, PASSWORD, HOMESERVER));
|
||||||
}
|
}
|
||||||
const storage = await createIdbStorage(`morpheus_session_${sessionId}`);
|
const storage = await createIdbStorage(`morpheus_session_${sessionId}`);
|
||||||
console.log("database created", storage);
|
|
||||||
const session = new Session(storage);
|
const session = new Session(storage);
|
||||||
if (loginData) {
|
if (loginData) {
|
||||||
await session.setLoginData(loginData);
|
await session.setLoginData(loginData);
|
||||||
}
|
}
|
||||||
await session.load();
|
await session.load();
|
||||||
const hsApi = new HomeServerApi(HOMESERVER, session.accessToken);
|
const hsApi = new HomeServerApi(HOMESERVER, session.accessToken);
|
||||||
console.log("session loaded", session, hsApi);
|
console.log("session loaded");
|
||||||
|
if (!session.syncToken) {
|
||||||
|
console.log("session needs initial sync");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
const sync = new Sync(hsApi, session, storage);
|
const sync = new Sync(hsApi, session, storage);
|
||||||
await sync.start();
|
await sync.start();
|
||||||
|
|
Loading…
Reference in a new issue