1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-15 01:16:22 +02:00

Fix/account for missing environments (#673)

* fix: add guards

* fix: remove console log

* fix: remove file

* fix: remove console log
This commit is contained in:
Fredrik Strand Oseberg 2022-02-04 10:13:18 +01:00 committed by GitHub
parent 7344f47635
commit 7336bc3ef6
2 changed files with 5 additions and 1 deletions

View File

@ -81,6 +81,8 @@ const FeatureOverviewEnvironment = ({
{} as { [key: string]: IStrategyIconObject }
);
if (!strategyObjects) return [];
return Object.keys(strategyObjects).map(strategyName => {
return { ...strategyObjects[strategyName], name: strategyName };
});

View File

@ -13,8 +13,10 @@ const FeatureOverviewEnvironmentMetrics = ({
}: IFeatureOverviewEnvironmentMetrics) => {
const styles = useStyles();
if (!environmentMetric) return null;
const total = environmentMetric.yes + environmentMetric.no;
const percentage = calculatePercentage(total, environmentMetric.yes);
const percentage = calculatePercentage(total, environmentMetric?.yes);
if (
!environmentMetric ||