From fa3bbd98e254f305ddb4ca7ae676e28f59023053 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 25 May 2023 19:48:56 +0100 Subject: [PATCH] Update references to `QrCodeEvent`, `SasEvent` and `VerificationEvent` --- .../views/dialogs/IncomingSasDialog.tsx | 13 ++++++------- .../views/right_panel/VerificationPanel.tsx | 18 +++++++++--------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/components/views/dialogs/IncomingSasDialog.tsx b/src/components/views/dialogs/IncomingSasDialog.tsx index ca7d9bbc3272..3772b689fa2c 100644 --- a/src/components/views/dialogs/IncomingSasDialog.tsx +++ b/src/components/views/dialogs/IncomingSasDialog.tsx @@ -15,9 +15,8 @@ limitations under the License. */ import React, { ReactNode } from "react"; -import { SasEvent } from "matrix-js-sdk/src/crypto/verification/SAS"; -import { VerificationBase, VerificationEvent } from "matrix-js-sdk/src/crypto/verification/Base"; -import { GeneratedSas, ShowSasCallbacks } from "matrix-js-sdk/src/crypto-api/verification"; +import { VerificationBase } from "matrix-js-sdk/src/crypto/verification/Base"; +import { GeneratedSas, ShowSasCallbacks, VerifierEvent } from "matrix-js-sdk/src/crypto-api/verification"; import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; @@ -38,7 +37,7 @@ const PHASE_VERIFIED = 3; const PHASE_CANCELLED = 4; interface IProps { - verifier: VerificationBase; + verifier: VerificationBase; onFinished(verified?: boolean): void; } @@ -74,8 +73,8 @@ export default class IncomingSasDialog extends React.Component { opponentProfileError: null, sas: null, }; - this.props.verifier.on(SasEvent.ShowSas, this.onVerifierShowSas); - this.props.verifier.on(VerificationEvent.Cancel, this.onVerifierCancel); + this.props.verifier.on(VerifierEvent.ShowSas, this.onVerifierShowSas); + this.props.verifier.on(VerifierEvent.Cancel, this.onVerifierCancel); this.fetchOpponentProfile(); } @@ -83,7 +82,7 @@ export default class IncomingSasDialog extends React.Component { if (this.state.phase !== PHASE_CANCELLED && this.state.phase !== PHASE_VERIFIED) { this.props.verifier.cancel(new Error("User cancel")); } - this.props.verifier.removeListener(SasEvent.ShowSas, this.onVerifierShowSas); + this.props.verifier.removeListener(VerifierEvent.ShowSas, this.onVerifierShowSas); } private async fetchOpponentProfile(): Promise { diff --git a/src/components/views/right_panel/VerificationPanel.tsx b/src/components/views/right_panel/VerificationPanel.tsx index 2b5679ea50ed..019d0affb96a 100644 --- a/src/components/views/right_panel/VerificationPanel.tsx +++ b/src/components/views/right_panel/VerificationPanel.tsx @@ -16,7 +16,7 @@ limitations under the License. import React from "react"; import { verificationMethods } from "matrix-js-sdk/src/crypto"; -import { QrCodeEvent, ReciprocateQRCode, SCAN_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode"; +import { ReciprocateQRCode, SCAN_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode"; import { Phase, VerificationRequest, @@ -24,10 +24,10 @@ import { } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; -import { SAS, SasEvent } from "matrix-js-sdk/src/crypto/verification/SAS"; +import { SAS } from "matrix-js-sdk/src/crypto/verification/SAS"; import { logger } from "matrix-js-sdk/src/logger"; import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; -import { ShowQrCodeCallbacks, ShowSasCallbacks } from "matrix-js-sdk/src/crypto-api/verification"; +import { ShowQrCodeCallbacks, ShowSasCallbacks, VerifierEvent } from "matrix-js-sdk/src/crypto-api/verification"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import VerificationQRCode from "../elements/crypto/VerificationQRCode"; @@ -402,8 +402,8 @@ export default class VerificationPanel extends React.PureComponent