Skip to content

Commit

Permalink
fix: Crash cake staking input (#10623)
Browse files Browse the repository at this point in the history
<!--
Before opening a pull request, please read the [contributing
guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md)
first
-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `LockCakeForm.tsx` file in the CakeStaking component
to handle input of a decimal point more effectively.

### Detailed summary
- Modified the `onUserInput` function to handle input of a decimal point
by converting it to '0.' before passing it to the function.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->

---------

Co-authored-by: Chef Jerry <144641937+ChefJerry@users.noreply.github.com>
  • Loading branch information
memoyil and ChefJerry authored Sep 4, 2024
1 parent e6e30bb commit 5b9eef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/web/src/views/CakeStaking/components/LockCakeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const CakeInput: React.FC<{
const onInput = useCallback(
(input: string) => {
setPercent(null)
onUserInput(input)
onUserInput(input === '.' ? '0.' : input)
},
[onUserInput],
)
Expand Down

0 comments on commit 5b9eef5

Please sign in to comment.