From 6144962c24abb78aa5add844974ba43b1c9db74b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 2 Apr 2020 12:53:52 +0200 Subject: [PATCH] cancel with m.user code when user doesn't reciprocate --- src/crypto/verification/QRCode.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crypto/verification/QRCode.js b/src/crypto/verification/QRCode.js index 1f5e0868c..6490dcebc 100644 --- a/src/crypto/verification/QRCode.js +++ b/src/crypto/verification/QRCode.js @@ -23,6 +23,7 @@ limitations under the License. import {VerificationBase as Base} from "./Base"; import { newKeyMismatchError, + newUserCancelledError, } from './Error'; import {encodeUnpaddedBase64, decodeBase64} from "../olmlib"; @@ -59,7 +60,7 @@ export class ReciprocateQRCode extends Base { await new Promise((resolve, reject) => { this.reciprocateQREvent = { confirm: resolve, - cancel: reject, // which code should we cancel with here? + cancel: () => reject(newUserCancelledError()), }; this.emit("show_reciprocate_qr", this.reciprocateQREvent); });