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 bad quote behavior #57

Merged
merged 3 commits into from
Jan 28, 2025
Merged

fix bad quote behavior #57

merged 3 commits into from
Jan 28, 2025

Conversation

Sladuca
Copy link
Contributor

@Sladuca Sladuca commented Jan 28, 2025

No description provided.

Copy link

semanticdiff-com bot commented Jan 28, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/helpers/units.ts  47% smaller
  src/lib/buy/index.tsx  0% smaller

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR improves quote handling and type safety in the buy order flow, focusing on more predictable behavior and better error handling.

  • Removed fallback to getAggressivePricePerHour in src/lib/buy/index.tsx to fail fast when no quote is found
  • Added new parseAndRoundStart function in src/lib/buy/index.tsx to properly handle edge cases in start time parsing
  • Added 'as const' type assertions for 'NOW' string literals to improve type safety throughout the codebase
  • Simplified roundStartDate function in src/helpers/units.ts by removing unnecessary else block while maintaining functionality
  • Modified quote handling to use start/end times directly from quotes instead of recalculating them

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@Sladuca Sladuca merged commit 0ced611 into main Jan 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant