mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
make a shared olm util for the whole session
This commit is contained in:
parent
9870483121
commit
81a1573e3b
@ -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 New Issue
Block a user