You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
Convert OlmDevice to Typescript
This commit is contained in:
@@ -36,7 +36,7 @@ import { IEventDecryptionResult } from "../index";
|
||||
const DeviceVerification = DeviceInfo.DeviceVerification;
|
||||
|
||||
interface IMessage {
|
||||
type: number | string;
|
||||
type: number;
|
||||
body: string;
|
||||
}
|
||||
|
||||
@@ -269,11 +269,11 @@ class OlmDecryption extends DecryptionAlgorithm {
|
||||
// not a prekey message: we can safely just try & decrypt it
|
||||
return this.reallyDecryptMessage(theirDeviceIdentityKey, message);
|
||||
} else {
|
||||
const myPromise = this.olmDevice._olmPrekeyPromise.then(() => {
|
||||
const myPromise = this.olmDevice.olmPrekeyPromise.then(() => {
|
||||
return this.reallyDecryptMessage(theirDeviceIdentityKey, message);
|
||||
});
|
||||
// we want the error, but don't propagate it to the next decryption
|
||||
this.olmDevice._olmPrekeyPromise = myPromise.catch(() => {});
|
||||
this.olmDevice.olmPrekeyPromise = myPromise.catch(() => {});
|
||||
return await myPromise;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user