diff --git a/src/components/views/messages/MKeyVerificationRequest.js b/src/components/views/messages/MKeyVerificationRequest.js index ab02b2e5ad..9a48858bc7 100644 --- a/src/components/views/messages/MKeyVerificationRequest.js +++ b/src/components/views/messages/MKeyVerificationRequest.js @@ -27,6 +27,7 @@ import {RIGHT_PANEL_PHASES} from "../../../stores/RightPanelStorePhases"; export default class MKeyVerificationRequest extends React.Component { constructor(props) { super(props); + this.state = {}; } componentDidMount() { @@ -58,6 +59,7 @@ export default class MKeyVerificationRequest extends React.Component { }; _onAcceptClicked = async () => { + this.setState({acceptOrCancelClicked: true}); const request = this.props.mxEvent.verificationRequest; if (request) { try { @@ -70,6 +72,7 @@ export default class MKeyVerificationRequest extends React.Component { }; _onRejectClicked = async () => { + this.setState({acceptOrCancelClicked: true}); const request = this.props.mxEvent.verificationRequest; if (request) { try { @@ -135,9 +138,10 @@ export default class MKeyVerificationRequest extends React.Component { subtitle = (
{ userLabelForEventRoom(request.requestingUserId, mxEvent.getRoomId())}
); if (request.requested && !request.observeOnly) { + const disabled = this.state.acceptOrCancelClicked; stateNode = (
- - + +
); } } else { // request sent by us diff --git a/src/components/views/right_panel/VerificationPanel.js b/src/components/views/right_panel/VerificationPanel.js index 9ec556f4bf..58cc42ddc1 100644 --- a/src/components/views/right_panel/VerificationPanel.js +++ b/src/components/views/right_panel/VerificationPanel.js @@ -101,8 +101,9 @@ export default class VerificationPanel extends React.PureComponent { if (pending) { button = ; } else { + const disabled = this.state.emojiButtonClicked; button = ( - + {_t("Verify by emoji")} ); @@ -219,6 +220,7 @@ export default class VerificationPanel extends React.PureComponent { } _startSAS = async () => { + this.setState({emojiButtonClicked: true}); const verifier = this.props.request.beginKeyVerification(verificationMethods.SAS); try { await verifier.verify();