Skip to content

Commit e4a0f61

Browse files
authored
fix: only show suppressed stat when > 0 (#176)
1 parent 2f5e91b commit e4a0f61

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ui/src/ReportStats.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export class ReportStats extends React.Component<ReportStatsProps> {
2323
this.props = props;
2424
}
2525

26+
suppressedCount = countReportSuppressed(this.props.report);
27+
2628
render() {
2729
const stats = [
2830
{
@@ -53,10 +55,12 @@ export class ReportStats extends React.Component<ReportStatsProps> {
5355
name: 'Licenses',
5456
value: countReportLicenses(this.props.report),
5557
},
56-
{
57-
name: 'Suppressed',
58-
value: countReportSuppressed(this.props.report),
59-
},
58+
this.suppressedCount > 0
59+
? {
60+
name: 'Suppressed',
61+
value: this.suppressedCount,
62+
}
63+
: {},
6064
];
6165
return (
6266
<Card className="flex-grow">

0 commit comments

Comments
 (0)