From b67256c7c2b0b68b4b54274fcbf70b2336a32134 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 24 Jan 2020 16:41:43 +0000 Subject: [PATCH] post-merge fix --- src/components/structures/RightPanel.js | 4 +-- .../views/right_panel/VerificationPanel.js | 30 +++++++++++++++++-- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 2188bda4f2..79955c8448 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -196,7 +196,7 @@ export default class RightPanel extends React.Component { }); }; panel = ; diff --git a/src/components/views/right_panel/VerificationPanel.js b/src/components/views/right_panel/VerificationPanel.js index cbabb1188a..0fdf16de65 100644 --- a/src/components/views/right_panel/VerificationPanel.js +++ b/src/components/views/right_panel/VerificationPanel.js @@ -19,7 +19,6 @@ import React from 'react'; import * as sdk from '../../../index'; import {verificationMethods} from 'matrix-js-sdk/src/crypto'; import VerificationQRCode from "../elements/crypto/VerificationQRCode"; -import {VerificationRequest} from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import {_t} from "../../../languageHandler"; import E2EIcon from "../rooms/E2EIcon"; @@ -32,9 +31,26 @@ export default class VerificationPanel extends React.PureComponent { } renderQRPhase() { - const {member} = this.props; + const {member, request} = this.props; // type req: VerificationRequest // TODO change the button into a spinner when on click const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); + + if (!request.requestEvent || !request.requestEvent.getId()) { + // TODO handle this error case + return

request.requestEvent.getId()

; + } + + const qrCodeKeys = [ + [MatrixClientPeg.get().getDeviceId(), MatrixClientPeg.get().getDeviceEd25519Key()], + [MatrixClientPeg.get().getCrossSigningId(), MatrixClientPeg.get().getCrossSigningId()], + ]; + const crossSigningInfo = MatrixClientPeg.get().getStoredCrossSigningForUser(request.otherUserId); + + if (!crossSigningInfo) { + // TODO handle this error case + return

crossSigningInfo

; + } + return

Verify by scanning

@@ -43,12 +59,20 @@ export default class VerificationPanel extends React.PureComponent { }, { a: t => { t }, })}

-
QR Code
+ +

Verify by emoji

{_t("If you can't scan the code above, verify by comparing unique emoji.")}

+ {_t("Verify by emoji")}