You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
await verify so errors (like cancellation) are caught
This commit is contained in:
@@ -75,12 +75,14 @@ export default class VerificationPanel extends React.PureComponent {
|
||||
this.setState({sasEvent});
|
||||
};
|
||||
|
||||
_onRequestChange = () => {
|
||||
_onRequestChange = async () => {
|
||||
const {request} = this.props;
|
||||
if (!this._hasVerifier && !!request.verifier) {
|
||||
request.verifier.on('show_sas', this._onVerifierShowSas);
|
||||
try {
|
||||
request.verifier.verify();
|
||||
// on the requester side, this is also awaited in _startSAS,
|
||||
// but that's ok as verify should return the same promise.
|
||||
await request.verifier.verify();
|
||||
} catch (err) {
|
||||
console.error("error verify", err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user