Skip to content

Commit

Permalink
fix: Handle the case when there are no errors but there are relays
Browse files Browse the repository at this point in the history
  • Loading branch information
RabeeAbuBaker committed Oct 18, 2023
1 parent d2066e5 commit 67a302d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/components/Sparkline/Sparkline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Sparkline = ({
>
<Text className="label">Date: {label}</Text>
<Text className="desc">
{payload[0].value
{payload[0].value || payload[0].value === 0
? `${
commifyValue ? commify(payload[0].value) : payload[0].value
} ${valueLabel}`
Expand Down
6 changes: 5 additions & 1 deletion app/utils/chartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { AnalyticsRelaysAggregated, AnalyticsRelaysTotal } from "~/models/dwh/sd
export const getTotalErrors = (
aggregatedData: AnalyticsRelaysAggregated | AnalyticsRelaysTotal,
) => {
if (!aggregatedData || !aggregatedData.rateError || !aggregatedData.countTotal) {
if (
!aggregatedData ||
!aggregatedData.countTotal ||
(!aggregatedData.rateError && aggregatedData?.rateError !== 0)
) {
return null
}

Expand Down

0 comments on commit 67a302d

Please sign in to comment.