-
Notifications
You must be signed in to change notification settings - Fork 190
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
The undeposit just withdraws the LP and not call the claim function #1645
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Code Review
Overview
The provided code patch modifies a component named
FarmStakeButtons
in a React application that interacts with a farming reward system. Specifically, it replaces the handling of a claim rewards action with an exit farming action.Changes Made
claimRewards
toexitFarmings
.Bug Risks
exitFarmingsHandler
is correctly implemented in theuseFarmingHandlers
hook and that it behaves as expected. If it is undefined or lacks proper error handling, it may lead to runtime errors.txType
and the relatedtxError
andtxConfirmed
booleans correctly aligns with the new exit action. The wrong state could lead to incorrect button disabled states or unresponsive buttons.exitFarmingsHandler(el.id, { ...el }, FarmingType.ETERNAL);
has the correct parameters, especially if the handler requires data structure similar to the previous claim handler. Mismatches could cause unexpected results.t('undepositing')
) implies withdrawal or a similar action. Make sure this text makes sense in the context of exiting farmings.Improvement Suggestions
exitFarmingsHandler
invocation to gracefully manage any issues that arise during the exit process.exitFarmingsHandler
and related states to prevent potential runtime issues.Conclusion
The patch seems straightforward, but careful attention should be paid to the new handler's implementation and its integration with the overall state management and user experience. Proper testing and validation will be essential to ensure the new functionality works as intended without introducing any bugs.