From db17321777ee7975cec10362cee11329482fd568 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 19 Dec 2019 16:28:23 +0000 Subject: [PATCH] await verify so errors (like cancellation) are caught --- src/components/views/right_panel/VerificationPanel.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/views/right_panel/VerificationPanel.js b/src/components/views/right_panel/VerificationPanel.js index e1f36cbc0f..2879916f37 100644 --- a/src/components/views/right_panel/VerificationPanel.js +++ b/src/components/views/right_panel/VerificationPanel.js @@ -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); }