mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 11:36:24 +01:00
Base stage class does not need disposable
This commit is contained in:
parent
806e672806
commit
dedf64d011
@ -43,7 +43,7 @@ export type Options = {
|
||||
eventEmitter: EventEmitter<SASProgressEvents>
|
||||
}
|
||||
|
||||
export abstract class BaseSASVerificationStage extends Disposables {
|
||||
export abstract class BaseSASVerificationStage {
|
||||
protected ourUser: UserData;
|
||||
protected otherUserId: string;
|
||||
protected log: ILogItem;
|
||||
@ -60,7 +60,6 @@ export abstract class BaseSASVerificationStage extends Disposables {
|
||||
protected eventEmitter: EventEmitter<SASProgressEvents>;
|
||||
|
||||
constructor(options: Options) {
|
||||
super();
|
||||
this.options = options;
|
||||
this.ourUser = options.ourUser;
|
||||
this.otherUserId = options.otherUserId;
|
||||
|
@ -90,7 +90,6 @@ export class CalculateSASStage extends BaseSASVerificationStage {
|
||||
const emoji = generateEmojiSas(Array.from(sasBytes));
|
||||
console.log("Emoji calculated:", emoji);
|
||||
this.setNextStage(new SendMacStage(this.options));
|
||||
this.dispose();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,6 @@ export class RequestVerificationStage extends BaseSASVerificationStage {
|
||||
await this.channel.send(VerificationEventTypes.Request, content, log);
|
||||
this.setNextStage(new SelectVerificationMethodStage(this.options));
|
||||
await this.channel.waitForEvent("m.key.verification.ready");
|
||||
this.dispose();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,6 @@ export class SelectVerificationMethodStage extends BaseSASVerificationStage {
|
||||
// We need to send the accept message next
|
||||
this.setNextStage(new SendAcceptVerificationStage(this.options));
|
||||
}
|
||||
this.dispose();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,6 @@ export class SendAcceptVerificationStage extends BaseSASVerificationStage {
|
||||
await this.channel.send(VerificationEventTypes.Accept, contentToSend, log);
|
||||
await this.channel.waitForEvent(VerificationEventTypes.Key);
|
||||
this.setNextStage(new SendKeyStage(this.options));
|
||||
this.dispose();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ export class SendDoneStage extends BaseSASVerificationStage {
|
||||
async completeStage() {
|
||||
await this.log.wrap("VerifyMacStage.completeStage", async (log) => {
|
||||
await this.channel.send(VerificationEventTypes.Done, {}, log);
|
||||
this.dispose();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ export class SendKeyStage extends BaseSASVerificationStage {
|
||||
*/
|
||||
await this.channel.waitForEvent(VerificationEventTypes.Key);
|
||||
this.setNextStage(new CalculateSASStage(this.options));
|
||||
this.dispose();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ export class SendMacStage extends BaseSASVerificationStage {
|
||||
await this.sendMAC(log);
|
||||
await this.channel.waitForEvent(VerificationEventTypes.Mac);
|
||||
this.setNextStage(new VerifyMacStage(this.options));
|
||||
this.dispose();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@ export class SendReadyStage extends BaseSASVerificationStage {
|
||||
};
|
||||
await this.channel.send(VerificationEventTypes.Ready, content, log);
|
||||
this.setNextStage(new SelectVerificationMethodStage(this.options));
|
||||
this.dispose();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,6 @@ export class VerifyMacStage extends BaseSASVerificationStage {
|
||||
await this.checkMAC(log);
|
||||
await this.channel.waitForEvent(VerificationEventTypes.Done);
|
||||
this.setNextStage(new SendDoneStage(this.options));
|
||||
this.dispose();
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user