Merge pull request #2776 from matrix-org/erikj/fix_null_counter

Fix simple header counters to correctly handle zero, take two
This commit is contained in:
J. Ryan Stinnett 2019-03-12 10:46:51 +00:00 committed by GitHub
commit 0791f220fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,35 +213,33 @@ module.exports = React.createClass({
const severity = counter.severity;
const stateKey = counter.stateKey;
if (title && value && severity) {
let span = <span>{ title }: { value }</span>
if (link) {
span = (
<a href={link} target="_blank" rel="noopener">
{ span }
</a>
);
}
let span = <span>{ title }: { value }</span>
if (link) {
span = (
<span
className="m_RoomView_auxPanel_stateViews_span"
data-severity={severity}
key={ "x-" + stateKey }
>
{span}
</span>
);
counters.push(span);
counters.push(
<span
className="m_RoomView_auxPanel_stateViews_delim"
key={"delim" + idx}
> </span>
<a href={link} target="_blank" rel="noopener">
{ span }
</a>
);
}
span = (
<span
className="m_RoomView_auxPanel_stateViews_span"
data-severity={severity}
key={ "x-" + stateKey }
>
{span}
</span>
);
counters.push(span);
counters.push(
<span
className="m_RoomView_auxPanel_stateViews_delim"
key={"delim" + idx}
> </span>
);
});
if (counters.length > 0) {