mirror of
https://github.com/element-hq/element-web
synced 2024-10-29 22:17:51 +03:00
render empty tiles when no request
This commit is contained in:
parent
075e42c076
commit
b49c471f05
2 changed files with 11 additions and 6 deletions
|
@ -48,12 +48,14 @@ export default class MKeyVerificationConclusion extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const {mxEvent} = this.props;
|
const {mxEvent} = this.props;
|
||||||
const request = mxEvent.verificationRequest;
|
const request = mxEvent.verificationRequest;
|
||||||
|
|
||||||
|
if (!request) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const client = MatrixClientPeg.get();
|
const client = MatrixClientPeg.get();
|
||||||
const myUserId = client.getUserId();
|
const myUserId = client.getUserId();
|
||||||
|
|
||||||
if (!request) {
|
|
||||||
return <p>This is a verification conclusion tile without a request.</p>;
|
|
||||||
}
|
|
||||||
|
|
||||||
let title;
|
let title;
|
||||||
|
|
||||||
|
@ -67,6 +69,8 @@ export default class MKeyVerificationConclusion extends React.Component {
|
||||||
title = _t("%(name)s cancelled verifying",
|
title = _t("%(name)s cancelled verifying",
|
||||||
{name: getNameForEventRoom(request.otherUserId, mxEvent)});
|
{name: getNameForEventRoom(request.otherUserId, mxEvent)});
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
title = `request conclusion tile with phase ${request.phase}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (title) {
|
if (title) {
|
||||||
|
|
|
@ -99,13 +99,14 @@ export default class MKeyVerificationRequest extends React.Component {
|
||||||
const {mxEvent} = this.props;
|
const {mxEvent} = this.props;
|
||||||
const request = mxEvent.verificationRequest;
|
const request = mxEvent.verificationRequest;
|
||||||
|
|
||||||
|
if (!request) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
let title;
|
let title;
|
||||||
let subtitle;
|
let subtitle;
|
||||||
let stateNode;
|
let stateNode;
|
||||||
|
|
||||||
if (!request) {
|
|
||||||
return <p>This is a verification request tile without a request.</p>;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request.ready || request.started || request.cancelled) {
|
if (request.ready || request.started || request.cancelled) {
|
||||||
let stateLabel;
|
let stateLabel;
|
||||||
|
|
Loading…
Reference in a new issue