forked from mystiq/hydrogen-web
make a shared olm util for the whole session
This commit is contained in:
parent
9870483121
commit
81a1573e3b
2 changed files with 4 additions and 3 deletions
|
@ -35,10 +35,11 @@ export class Session {
|
|||
this._user = new User(sessionInfo.userId);
|
||||
this._olm = olm;
|
||||
this._e2eeAccount = null;
|
||||
const olmUtil = olm ? new olm.Utility() : null;
|
||||
this._deviceTracker = olm ? new DeviceTracker({
|
||||
storage,
|
||||
getSyncToken: () => this.syncToken,
|
||||
olm,
|
||||
olmUtil,
|
||||
}) : null;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,11 +36,11 @@ function deviceKeysAsDeviceIdentity(deviceSection) {
|
|||
}
|
||||
|
||||
export class DeviceTracker {
|
||||
constructor({storage, getSyncToken, olm}) {
|
||||
constructor({storage, getSyncToken, olmUtil}) {
|
||||
this._storage = storage;
|
||||
this._getSyncToken = getSyncToken;
|
||||
this._identityChangedForRoom = null;
|
||||
this._olmUtil = new olm.Utility();
|
||||
this._olmUtil = olmUtil;
|
||||
}
|
||||
|
||||
async writeDeviceChanges(deviceLists, txn) {
|
||||
|
|
Loading…
Reference in a new issue