This commit is contained in:
Bruno Windels 2019-02-07 01:03:47 +00:00
parent abffdf1877
commit c05e40188b
2 changed files with 10 additions and 5 deletions

View file

@ -1,5 +1,10 @@
# Minimal thing to get working
- given an access token, a working sync loop that echoes all the messages
- allow sync to resume from storage
-
- finish summary store
- add eventemitter
- make sync work
- store summaries
- setup editorconfig
- setup linting (also in editor)
- store timeline
- store state

View file

@ -1,11 +1,11 @@
export default class Session {
// loginData has device_id, user_id, home_server, access_token
constructor(storage) {
this._storage = storage;
this._session = null;
this._rooms = null;
}
// should be called before load
// loginData has device_id, user_id, home_server, access_token
async setLoginData(loginData) {
const txn = this._storage.readWriteTxn([this._storage.storeNames.session]);
const session = {loginData};
@ -43,7 +43,7 @@ export default class Session {
applySync(syncToken, accountData, txn) {
this._session.syncToken = syncToken;
txn.session.setSession(this._session);
txn.session.set(this._session);
}
get syncToken() {