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) {
button = <Spinner />;
} else {
const disabled = this.state.emojiButtonClicked;
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")}
</AccessibleButton>
);
@ -196,6 +197,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();