Throw error if verification was cancelled

This commit is contained in:
RMidhunSuresh 2023-03-14 14:13:57 +05:30
parent 9c82dd7ce3
commit fd96d5843d
No known key found for this signature in database

View File

@ -249,6 +249,9 @@ export class ToDeviceChannel extends Disposables implements IChannel {
}
waitForEvent(eventType: string): Promise<any> {
if (this._isCancelled) {
throw new VerificationCancelledError();
}
// Check if we already received the message
const receivedMessage = this.receivedMessages.get(eventType);
if (receivedMessage) {