1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00

fix: fall back to count === 0 if undefined / don't show "0 of undefined"

If the total number of flag is undefined, we've previously shown "0 of undefined". However, I don't think that's sensible. Instead, we should show "0".
This commit is contained in:
Thomas Heartman 2025-09-24 13:02:26 +02:00
parent b4ad9c964f
commit 0dee500b80
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -84,7 +84,7 @@ export const LifecycleFilters = ({
: allFlagsCount || undefined;
const dynamicLabel =
isActive && Number.isInteger(total)
? `${label} (${total === count ? total : `${total} of ${count}`})`
? `${label} (${total === (count ?? 0) ? total : `${total} of ${count}`})`
: `${label}${count !== undefined ? ` (${count})` : ''}`;
const handleClick = () =>