diff --git a/src/matrix/Session.js b/src/matrix/Session.js index 90db1b68..4d30516a 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -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; } diff --git a/src/matrix/e2ee/DeviceTracker.js b/src/matrix/e2ee/DeviceTracker.js index 5eaa23b7..b085be80 100644 --- a/src/matrix/e2ee/DeviceTracker.js +++ b/src/matrix/e2ee/DeviceTracker.js @@ -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) {