-
-
Notifications
You must be signed in to change notification settings - Fork 36
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: Footer Count Error #296
Conversation
…e range for footer count
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous review comment: Making count query api call without fields is not yet resolved.
src/hooks/useQueryResult.tsx
Outdated
{ | ||
onSuccess: (data: CountResponse) => { | ||
const count = _.first(data)?.count; | ||
count !== undefined && setLogsStore((store) => setTotalCount(store, count)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when null ?
Appropriate check here would be setting the count only if its a number.
src/hooks/useQueryResult.tsx
Outdated
refetch: refetchCount, | ||
} = useQuery( | ||
['fetchCount', logsQuery], | ||
async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refer https://github.com/parseablehq/console/blob/main/src/hooks/useGetStreamInfo.tsx to get an idea about existing practice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the existing practice to use useQuery
This pr fix the bug where queries are not fired on change of time range for footer count.