-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: "Start Agent" button fix #235
Conversation
mohandast52
commented
Jul 18, 2024
•
edited
Loading
edited
- "Start Agent" button was repeated three times, causing the loading and other states to be deprioritized due to overlapping conditions.
- Refactored the code to have a single "Start Agent" button at the bottom and added props in the condition.
- It should work exactly the same as before and especially show different states when the "Start Agent" button is clicked after eviction.
</Button> | ||
); | ||
} | ||
const canActivateAgent = canStartAgent && (isAgentEvicted || isDeployable); |
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.
getting lost with these can
variables, they need more context
i.e. canStartAgent
is not solely determined by the staking contract, and needs to be renamed to something more fitting, unsure what exactly but it should infer it's relation to the staking contract
canActivateAgent
, i'm lost on what this represents too :/ canStartAgent already factors in isAgentEvicted
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.
looks good but need to rename appropriately so it's more obvious what state we're setting conditions against 🙏