1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

fix: precise selected all chips check (#5945)

This commit is contained in:
Mateusz Kwasniewski 2024-01-18 11:53:56 +01:00 committed by GitHub
parent 567099a15b
commit f5cf118b12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -56,7 +56,9 @@ export const FeatureMetrics = () => {
}
}, [JSON.stringify(Array.from(applications))]);
const allSelected = selectedApplications.length === applications.size;
const allSelected = [...applications].every((element) =>
selectedApplications.includes(element),
);
const { featureMetrics } = useFeatureMetricsRaw(featureId, hoursBack);

View File

@ -50,7 +50,9 @@ export const FeatureMetricsChips = ({
const onClick = (value: string) => () => {
toggleValue(value);
};
const allSelected = values.size === selectedValues.length;
const allSelected = [...values].every((element) =>
selectedValues.includes(element),
);
const sortedValues = useMemo(() => {
return Array.from(values).sort((valueA, valueB) => {