1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Fix more typescript --strict violations (#2795)

* Stash tsc fixes

* Iterate

* Iterate

* Iterate

* Fix tests

* Iterate

* Iterate

* Iterate

* Iterate

* Add tests
This commit is contained in:
Michael Telatynski
2022-10-25 18:31:40 +01:00
committed by GitHub
parent 4b3e6939d6
commit 9f2f08dfd3
77 changed files with 829 additions and 733 deletions

View File

@@ -233,10 +233,10 @@ type EventHandlerMap = {
* @extends {module:crypto/verification/Base}
*/
export class SAS extends Base<SasEvent, EventHandlerMap> {
private waitingForAccept: boolean;
public ourSASPubKey: string;
public theirSASPubKey: string;
public sasEvent: ISasEvent;
private waitingForAccept?: boolean;
public ourSASPubKey?: string;
public theirSASPubKey?: string;
public sasEvent?: ISasEvent;
// eslint-disable-next-line @typescript-eslint/naming-convention
public static get NAME(): string {
@@ -279,7 +279,7 @@ export class SAS extends Base<SasEvent, EventHandlerMap> {
return false;
}
const content = event.getContent();
return content && content.method === SAS.NAME && this.waitingForAccept;
return content?.method === SAS.NAME && !!this.waitingForAccept;
}
private async sendStart(): Promise<Record<string, any>> {
@@ -400,7 +400,7 @@ export class SAS extends Base<SasEvent, EventHandlerMap> {
private async doRespondVerification(): Promise<void> {
// as m.related_to is not included in the encrypted content in e2e rooms,
// we need to make sure it is added
let content = this.channel.completedContentFromEvent(this.startEvent);
let content = this.channel.completedContentFromEvent(this.startEvent!);
// Note: we intersect using our pre-made lists, rather than the sets,
// so that the result will be in our order of preference. Then