You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2026-01-03 23:22:30 +03:00
fix new way of calling OlmDevice.init
This commit is contained in:
@@ -99,7 +99,7 @@ describe("OlmDevice", function() {
|
||||
);
|
||||
|
||||
const bobRecreatedOlmDevice = makeOlmDevice();
|
||||
bobRecreatedOlmDevice.init(exported);
|
||||
bobRecreatedOlmDevice.init({ fromExportedDevice: exported });
|
||||
|
||||
const decrypted = await bobRecreatedOlmDevice.createInboundSession(
|
||||
aliceOlmDevice.deviceCurve25519Key,
|
||||
@@ -123,7 +123,7 @@ describe("OlmDevice", function() {
|
||||
);
|
||||
|
||||
const bobRecreatedAgainOlmDevice = makeOlmDevice();
|
||||
bobRecreatedAgainOlmDevice.init(exportedAgain);
|
||||
bobRecreatedAgainOlmDevice.init({ fromExportedDevice: exportedAgain });
|
||||
|
||||
// Note: "decrypted_2" does not have the same structure as "decrypted"
|
||||
const decrypted2 = await bobRecreatedAgainOlmDevice.decryptMessage(
|
||||
|
||||
@@ -123,7 +123,7 @@ export function OlmDevice(cryptoStore) {
|
||||
* (exported data already provides a pickle key)
|
||||
* @param {object} opts.pickleKey (Optional) pickle key to set instead of default one
|
||||
*/
|
||||
OlmDevice.prototype.init = async function(opts) {
|
||||
OlmDevice.prototype.init = async function(opts = {}) {
|
||||
let e2eKeys;
|
||||
const account = new global.Olm.Account();
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ Crypto.prototype.init = async function(opts) {
|
||||
? "Crypto: initialising Olm device from exported device..."
|
||||
: "Crypto: initialising Olm device...",
|
||||
);
|
||||
await this._olmDevice.init(exportedOlmDevice);
|
||||
await this._olmDevice.init({ fromExportedDevice: exportedOlmDevice });
|
||||
logger.log("Crypto: loading device list...");
|
||||
await this._deviceList.load();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user