Merge pull request #2776 from matrix-org/erikj/fix_null_counter
Fix simple header counters to correctly handle zero, take twopull/21833/head
commit
0791f220fb
|
@ -213,35 +213,33 @@ module.exports = React.createClass({
|
||||||
const severity = counter.severity;
|
const severity = counter.severity;
|
||||||
const stateKey = counter.stateKey;
|
const stateKey = counter.stateKey;
|
||||||
|
|
||||||
if (title && value && severity) {
|
let span = <span>{ title }: { value }</span>
|
||||||
let span = <span>{ title }: { value }</span>
|
|
||||||
|
|
||||||
if (link) {
|
|
||||||
span = (
|
|
||||||
<a href={link} target="_blank" rel="noopener">
|
|
||||||
{ span }
|
|
||||||
</a>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (link) {
|
||||||
span = (
|
span = (
|
||||||
<span
|
<a href={link} target="_blank" rel="noopener">
|
||||||
className="m_RoomView_auxPanel_stateViews_span"
|
{ span }
|
||||||
data-severity={severity}
|
</a>
|
||||||
key={ "x-" + stateKey }
|
|
||||||
>
|
|
||||||
{span}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
|
|
||||||
counters.push(span);
|
|
||||||
counters.push(
|
|
||||||
<span
|
|
||||||
className="m_RoomView_auxPanel_stateViews_delim"
|
|
||||||
key={"delim" + idx}
|
|
||||||
> ─ </span>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
if (counters.length > 0) {
|
||||||
|
|
Loading…
Reference in New Issue