Skip to content

Commit

Permalink
chore add a fallback if item.active does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
rabi-siddique committed Jun 7, 2024
1 parent f6ee73a commit 49564ce
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/pages/Liquidated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,14 @@ export function Liquidated() {

const graphDataList = populateMissingDays(graphDataMap, GRAPH_DAYS);

const summedGraphDataList = graphDataList.map((item) => ({
...item,
active: sum(Object.values(item.active)),
liquidated: sum(Object.values(item.active)),
}));
const summedGraphDataList = graphDataList.map((item) => {
const total = item.active ? sum(Object.values(item.active)) : 0;
return {
...item,
active: total,
liquidated: total,
};
});

return (
<>
Expand All @@ -77,7 +80,7 @@ export function Liquidated() {
<ValueCardGrid>
<LiquidatedVaultCountCard data={response?.vaultManagerMetrics?.nodes} isLoading={isLoading} />
</ValueCardGrid>
{/* <VaultStatesChart data={summedGraphDataList} isLoading={graphDataIsLoading} /> */}
<VaultStatesChart data={summedGraphDataList} isLoading={graphDataIsLoading} />
<hr className="my-5" />
<LiquidatedVaults data={liquidationDashboardData} boardAuxes={boardAuxes} isLoading={isLoading} />
</PageContent>
Expand Down

0 comments on commit 49564ce

Please sign in to comment.