-
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: Add checks against contract no funds and full slots cases #162
Conversation
mohandast52
commented
May 31, 2024
•
edited
Loading
edited
- The user should not be able to start the agent if there are no rewards available or if all slots are full.
- Please check the conditions here
@oaksprout please suggest on message copies please 🙏 |
on second thoughts, we should not do this :/ |
Maybe this could be simpler: What if the button text became "Cannot start agent ℹ️" And then a tooltip shows when you hover over which lists the reasons why:
"Jobs" being a human-friendly concept for 'slots'. Curious to hear Roman's thoughts. |
…p into mohan/checks-against-contract-no-funds
…p into mohan/checks-against-contract-no-funds
|
||
enum ServiceButtonLoadingState { | ||
Starting, | ||
Pausing, | ||
NotLoading, | ||
} | ||
|
||
const FirstRunModal = ({ |
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.
moved to a separate file - FirstRunModal.tsx
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.
either move this to hooks folder (as it exports a hook)
or move the store folder to the root, it does not contain components
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.
the file name has typo too :/
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.
- moved to the root folder
- but I still believe we should keep related components/hooks/functions together. In this case, it should be in
MainHeader
since no other component uses it. We can move it if other components need it in the future instead of putting everything in thehooks
orfunctions
folder. Otherwise, it will eventually become cluttered and difficult to manage.
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.
not sure if the above changes were added recently or not, but really need to stop putting things in random places
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.
1 tiny comment, lgtm overall
@mohandast52 i'm sorry, but on thinking about this more, we should not include zustand. |
const [canStartAgent, setCanStartAgent] = useState(false); | ||
|
||
useEffect(() => { | ||
(async () => { |
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.
we'll need to extract this into a useCallback function at a later point so we can call it on demand, and also update the state via interval. but it's fine for now 👍