From 081baa23592c0a6d2677dcd09e4b67d44a2a474b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 2 Apr 2020 17:12:10 +0200 Subject: [PATCH] set dialog title for self-verification use request.isSelfVerification helper --- .../views/dialogs/VerificationRequestDialog.js | 17 +++++++++++++++-- .../views/right_panel/VerificationPanel.js | 8 ++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/components/views/dialogs/VerificationRequestDialog.js b/src/components/views/dialogs/VerificationRequestDialog.js index bbf3482a41..88ca0bc337 100644 --- a/src/components/views/dialogs/VerificationRequestDialog.js +++ b/src/components/views/dialogs/VerificationRequestDialog.js @@ -30,16 +30,29 @@ export default class VerificationRequestDialog extends React.Component { constructor(...args) { super(...args); this.onFinished = this.onFinished.bind(this); + this.state = {}; + if (this.props.verificationRequest) { + this.state.verificationRequest = this.props.verificationRequest; + } else if (this.props.verificationRequestPromise) { + this.props.verificationRequestPromise.then(r => { + this.setState({verificationRequest: r}); + }); + } } render() { const BaseDialog = sdk.getComponent("views.dialogs.BaseDialog"); const EncryptionPanel = sdk.getComponent("views.right_panel.EncryptionPanel"); + const request = this.state.verificationRequest; + const otherUserId = request && request.otherUserId; const member = this.props.member || - MatrixClientPeg.get().getUser(this.props.verificationRequest.otherUserId); + otherUserId && MatrixClientPeg.get().getUser(otherUserId); + const title = request && request.isSelfVerification ? + _t("Verify this session") : _t("Verification Request"); + return