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

Fix header counters to correctly handle zero
pull/21833/head
Travis Ralston 2019-03-11 15:10:53 -06:00 committed by GitHub
commit 1165c51c77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -122,7 +122,9 @@ module.exports = React.createClass({
const severity = ev.getContent().severity || "normal";
const stateKey = ev.getStateKey();
if (title && value && severity) {
// We want a non-empty title but can accept falsey values (e.g.
// zero)
if (title && value !== undefined) {
counters.push({
"title": title,
"value": value,