Skip to content

Commit 27679ac

Browse files
committed
fix: neutral state for dashboard kpis
1 parent c65e5bc commit 27679ac

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

public/admin/app-render.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,13 +515,9 @@ function dashDelta(current, previous) {
515515

516516
function dashDeltaHtml(value, inverted) {
517517
if (value === null || value === undefined) return "";
518+
if (value === 0) return '<div class="dash-kpi-delta neutral">\u2014</div>';
518519
const sign = value > 0 ? "+" : "";
519-
const cls =
520-
value === 0
521-
? "neutral"
522-
: value > 0 !== (inverted || false)
523-
? "positive"
524-
: "negative";
520+
const cls = value > 0 !== (inverted || false) ? "positive" : "negative";
525521
return `<div class="dash-kpi-delta ${cls}">${sign}${value}% vs prev</div>`;
526522
}
527523

0 commit comments

Comments
 (0)