Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Prevent NaN error in Campaign Overview Stat Widget #7698

Merged
merged 3 commits into from
Feb 10, 2025
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
refactor: Replace NaN check with undefined check
kjohnson committed Jan 28, 2025
commit d3077e7d6192bbefd8e30d8305b883145e5cf0cb
Original file line number Diff line number Diff line change
@@ -96,7 +96,10 @@ const StatWidget = ({label, values, description, formatter = null}) => {
</header>
<div className={styles.statWidgetAmount}>
<DisplayText>
{!isNaN(values[0]) ? formatter?.format(values[0]) ?? values[0] : (<span>&nbsp;</span>)}
{'undefined' !== typeof values[0]
? formatter?.format(values[0]) ?? values[0]
: <span>&nbsp;</span>
}
</DisplayText>
{!!values[1] && (
<PercentChangePill value={values[0]} comparison={values[1]} />