From 03d60e6af2b67d0c5a784d42476ce0d41cdd48aa Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 11 Mar 2019 14:04:12 +0000 Subject: [PATCH] Fix header counters to correctly handle zero Currently if you set the value to zero the counter is not displayed. --- src/components/views/rooms/AuxPanel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/AuxPanel.js b/src/components/views/rooms/AuxPanel.js index f52a3c52ab..e84629e89d 100644 --- a/src/components/views/rooms/AuxPanel.js +++ b/src/components/views/rooms/AuxPanel.js @@ -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,