1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

cancel with m.user code when user doesn't reciprocate

This commit is contained in:
Bruno Windels
2020-04-02 12:53:52 +02:00
parent 544cc36006
commit 6144962c24

View File

@@ -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);
});