mirror of
https://github.com/element-hq/element-web
synced 2024-10-29 22:17:51 +03:00
await verify so errors (like cancellation) are caught
This commit is contained in:
parent
b36df73300
commit
db17321777
1 changed files with 4 additions and 2 deletions
|
@ -75,12 +75,14 @@ export default class VerificationPanel extends React.PureComponent {
|
||||||
this.setState({sasEvent});
|
this.setState({sasEvent});
|
||||||
};
|
};
|
||||||
|
|
||||||
_onRequestChange = () => {
|
_onRequestChange = async () => {
|
||||||
const {request} = this.props;
|
const {request} = this.props;
|
||||||
if (!this._hasVerifier && !!request.verifier) {
|
if (!this._hasVerifier && !!request.verifier) {
|
||||||
request.verifier.on('show_sas', this._onVerifierShowSas);
|
request.verifier.on('show_sas', this._onVerifierShowSas);
|
||||||
try {
|
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) {
|
} catch (err) {
|
||||||
console.error("error verify", err);
|
console.error("error verify", err);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue