mirror of https://github.com/vector-im/riot-web
Merge pull request #3976 from matrix-org/bwindels/fixstartrace-rebased
Verification: don't block UI update on verification finishingpull/21833/head
commit
a687e4a220
|
@ -32,6 +32,13 @@ export default class ViewSourceEvent extends React.PureComponent {
|
|||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const {mxEvent} = this.props;
|
||||
if (mxEvent.isBeingDecrypted()) {
|
||||
mxEvent.once("Event.decrypted", () => this.forceUpdate());
|
||||
}
|
||||
}
|
||||
|
||||
onToggle = (ev) => {
|
||||
ev.preventDefault();
|
||||
const { expanded } = this.state;
|
||||
|
|
|
@ -218,8 +218,10 @@ export default class VerificationPanel extends React.PureComponent {
|
|||
|
||||
_onRequestChange = async () => {
|
||||
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 +229,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() {
|
||||
|
|
|
@ -56,7 +56,10 @@ export default class VerificationRequestToast extends React.PureComponent {
|
|||
|
||||
_checkRequestIsPending = () => {
|
||||
const {request} = this.props;
|
||||
if (request.ready || request.started || request.done || request.cancelled || request.observeOnly) {
|
||||
const isPendingInRoomRequest = request.channel.roomId &&
|
||||
!(request.ready || request.started || request.done || request.cancelled || request.observeOnly);
|
||||
const isPendingDeviceRequest = request.channel.deviceId && request.started;
|
||||
if (!isPendingInRoomRequest && !isPendingDeviceRequest) {
|
||||
ToastStore.sharedInstance().dismissToast(this.props.toastKey);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue