mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
update immediately, don't wait until verification is done
this can deadlock, as you can't finish the verification without the UI
This commit is contained in:
parent
c4f1659116
commit
59dc3cfb97
@ -217,9 +217,12 @@ export default class VerificationPanel extends React.PureComponent {
|
||||
};
|
||||
|
||||
_onRequestChange = async () => {
|
||||
this.forceUpdate();
|
||||
const {request} = this.props;
|
||||
if (!this._hasVerifier && !!request.verifier) {
|
||||
request.verifier.on('show_sas', this._onVerifierShowSas);
|
||||
const hadVerifier = this._hasVerifier;
|
||||
this._hasVerifier = !!request.verifier;
|
||||
if (!hadVerifier && this._hasVerifier) {
|
||||
request.verifier.once('show_sas', this._onVerifierShowSas);
|
||||
try {
|
||||
// on the requester side, this is also awaited in _startSAS,
|
||||
// but that's ok as verify should return the same promise.
|
||||
@ -227,10 +230,7 @@ export default class VerificationPanel extends React.PureComponent {
|
||||
} catch (err) {
|
||||
console.error("error verify", err);
|
||||
}
|
||||
} else if (this._hasVerifier && !request.verifier) {
|
||||
request.verifier.removeListener('show_sas', this._onVerifierShowSas);
|
||||
}
|
||||
this._hasVerifier = !!request.verifier;
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
|
Loading…
Reference in New Issue
Block a user