Skip to content

Commit

Permalink
fix(web): wrong condition to display taxes income synthesis impact
Browse files Browse the repository at this point in the history
  • Loading branch information
cdhenin committed Jan 7, 2025
1 parent de418fc commit a7ad952
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { convertCarbonToCO2eq, isLocalAuthority } from "shared";
import { convertCarbonToCO2eq, isLocalAuthority, sumListWithKey } from "shared";

import { getPercentageDifference } from "@/shared/services/percentage/percentage";

Expand Down Expand Up @@ -126,11 +126,11 @@ const getTaxesIncomeImpact = (impactsData?: ReconversionProjectImpactsResult["im
impact === "local_transfer_duties_increase",
);

if (!taxesIncomes || taxesIncomes.length > 0) {
if (!taxesIncomes || taxesIncomes.length === 0) {
return undefined;
}

return taxesIncomes.reduce((total, { amount }) => total + amount, 0);
return sumListWithKey(taxesIncomes, "amount");
};

const getFullTimeJobsImpact = (impactsData?: ReconversionProjectImpactsResult["impacts"]) => {
Expand Down

0 comments on commit a7ad952

Please sign in to comment.