to_device requests now can include .request so we might need send .ready

This commit is contained in:
Bruno Windels 2020-01-31 12:20:11 +01:00
parent a865cfb013
commit 8c3004c2ac

View file

@ -83,12 +83,13 @@ export default class CompleteSecurity extends React.Component {
} }
} }
onVerificationRequest = (request) => { onVerificationRequest = async (request) => {
if (request.otherUserId !== MatrixClientPeg.get().getUserId()) return; if (request.otherUserId !== MatrixClientPeg.get().getUserId()) return;
if (this.state.verificationRequest) { if (this.state.verificationRequest) {
this.state.verificationRequest.off("change", this.onVerificationRequestChange); this.state.verificationRequest.off("change", this.onVerificationRequestChange);
} }
await request.accept();
request.on("change", this.onVerificationRequestChange); request.on("change", this.onVerificationRequestChange);
this.setState({ this.setState({
verificationRequest: request, verificationRequest: request,