Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use double question mark
  • Loading branch information
deansheather committed Aug 18, 2025
commit 13ffbe7ad0b5a6eb26f65e696979795b5212d6a0
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ export const ManagedAgentsConsumption: FC<ManagedAgentsConsumptionProps> = ({
);
}

const valueOrZero = (value: number | undefined | null) =>
value === undefined || value === null ? 0 : value;

const usage = valueOrZero(managedAgentFeature.actual);
const included = valueOrZero(managedAgentFeature.soft_limit);
const limit = valueOrZero(managedAgentFeature.limit);
const usage = managedAgentFeature.actual ?? 0;
const included = managedAgentFeature.soft_limit ?? 0;
const limit = managedAgentFeature.limit ?? 0;
Copy link
Member

@aslilac aslilac Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not coercing these to 0 was intentional. if we get past the enabled check then these need to be some positive integer. (except usage, which can also be 0)

const startDate = managedAgentFeature.usage_period?.start;
const endDate = managedAgentFeature.usage_period?.end;

Expand Down
Loading