disable "verify by emoji" after clicking it

This commit is contained in:
Bruno Windels 2020-02-02 10:48:02 +01:00
parent 413a149b47
commit 577121e88d

View file

@ -62,8 +62,9 @@ export default class VerificationPanel extends React.PureComponent {
if (pending) { if (pending) {
button = <Spinner />; button = <Spinner />;
} else { } else {
const disabled = this.state.emojiButtonClicked;
button = ( button = (
<AccessibleButton kind="primary" className="mx_UserInfo_wideButton" onClick={this._startSAS}> <AccessibleButton disabled={disabled} kind="primary" className="mx_UserInfo_wideButton" onClick={this._startSAS}>
{_t("Verify by emoji")} {_t("Verify by emoji")}
</AccessibleButton> </AccessibleButton>
); );
@ -196,6 +197,7 @@ export default class VerificationPanel extends React.PureComponent {
} }
_startSAS = async () => { _startSAS = async () => {
this.setState({emojiButtonClicked: true});
const verifier = this.props.request.beginKeyVerification(verificationMethods.SAS); const verifier = this.props.request.beginKeyVerification(verificationMethods.SAS);
try { try {
await verifier.verify(); await verifier.verify();