render empty tiles when no request

This commit is contained in:
Bruno Windels 2019-12-20 21:31:36 +01:00
parent 075e42c076
commit b49c471f05
2 changed files with 11 additions and 6 deletions

View file

@ -48,12 +48,14 @@ export default class MKeyVerificationConclusion extends React.Component {
render() {
const {mxEvent} = this.props;
const request = mxEvent.verificationRequest;
if (!request) {
return null;
}
const client = MatrixClientPeg.get();
const myUserId = client.getUserId();
if (!request) {
return <p>This is a verification conclusion tile without a request.</p>;
}
let title;
@ -67,6 +69,8 @@ export default class MKeyVerificationConclusion extends React.Component {
title = _t("%(name)s cancelled verifying",
{name: getNameForEventRoom(request.otherUserId, mxEvent)});
}
} else {
title = `request conclusion tile with phase ${request.phase}`;
}
if (title) {

View file

@ -99,13 +99,14 @@ export default class MKeyVerificationRequest extends React.Component {
const {mxEvent} = this.props;
const request = mxEvent.verificationRequest;
if (!request) {
return null;
}
let title;
let subtitle;
let stateNode;
if (!request) {
return <p>This is a verification request tile without a request.</p>;
}
if (request.ready || request.started || request.cancelled) {
let stateLabel;