Skip to content

Commit

Permalink
fix consistent returns warning
Browse files Browse the repository at this point in the history
  • Loading branch information
goplayoutside3 committed Nov 15, 2024
1 parent 9468468 commit 6db35bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function YourProjectStats({
valueLoading={loading}
/>
</Box>
<ClassificationsChartContainer stats={data.sevenDaysStats} />
<ClassificationsChartContainer stats={data?.sevenDaysStats} />
</Box>
) : null}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ async function fetchUserCreatedAt(userID) {
}
try {
const response = await panoptes.get(`/users`, userQuery, { ...headers }, host)
if (response.ok) {
return response.body.users[0].created_at.substring(0, 10)
}
return response.body.users[0].created_at.substring(0, 10)
} catch (error) {
console.error('Error loading user with id:', userID)
logToSentry(error)
}
return ''
}

/* Same technique as getDefaultDateRange() in lib-user */
Expand Down Expand Up @@ -95,6 +94,7 @@ async function fetchStats({ endpoint, projectID, userID, authorization }) {
console.error('Error fetching stats', error)
logToSentry(error)
}
return null
}

export default function useYourProjectStats({ projectID, userID }) {
Expand Down

0 comments on commit 6db35bd

Please sign in to comment.