Closed rodrigopavezi closed 2 months ago
[!WARNING]
Rate limit exceeded
@rodrigopavezi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 14 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.Commits
Files that changed from the base of the PR and between 46c12b61829e8e413697d01f9dfa2d27fc1097ee and a4c2722273d3e3178f05e2d058e6891144f61419.
The changes in the useExportPDF
function improve the calculateItemTotal
function by introducing default values for potentially undefined properties of the item
object. This prevents NaN
results in calculations by ensuring that item.discount
, item.unitPrice
, and item.tax?.amount
default to 0
if they are undefined or null. The overall functionality remains unchanged, but the implementation is now more robust against missing data.
File | Change Summary |
---|---|
src/lib/hooks/use-export-pdf.tsx |
Enhanced calculateItemTotal to provide default values for item.discount , item.unitPrice , and item.tax?.amount to prevent NaN results in calculations. No changes to function signatures. |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Changes:
Summary by CodeRabbit
NaN
results.