Skip to content

fix: allow null premium default to unblock order creation#2434

Open
kanishka0411 wants to merge 1 commit intoRoboSats:mainfrom
kanishka0411:fix/premium-default-null-blocking-order
Open

fix: allow null premium default to unblock order creation#2434
kanishka0411 wants to merge 1 commit intoRoboSats:mainfrom
kanishka0411:fix/premium-default-null-blocking-order

Conversation

@kanishka0411
Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #2433

This PR introduces/refactors/...

"Create Order" button stays disabled when the premium field is left untouched, because defaultMaker sets premium: null and the validation rejects non-number types. Fixed by allowing null premium in disableSubmit (treating it as 0% market price) and using ?? 0 in price/limit math to prevent NaN.

Checklist before merging

  • Install pre-commit and initialize it: pip install pre-commit, then pre-commit install. Pre-commit installs git hooks that automatically check the codebase. If pre-commit fails when you commit your changes, please fix the problems it points out.

@alicecoordinator
Copy link
Copy Markdown
Contributor

I believe it would make sense to restrict this behavior to buy orders. It is less likely that a seller would like to sell for market price, and one could accidentally forget to fill the premium field.

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.

Bug: "Create Order" button stays disabled when premium field is not manually edited

2 participants