[Human App Frontend] Fix Staking requirement error and Add link to the staking doc#3759
[Human App Frontend] Fix Staking requirement error and Add link to the staking doc#3759
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
4 Skipped Deployments
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a logic conflict on the worker profile page where users were incorrectly blocked from proceeding when staking requirements were met but API key errors occurred. It also adds a link to staking documentation for creating API keys.
Changes:
- Separated staking validation logic from API key error handling to prevent false blocking
- Added notification system to display API key errors without blocking users
- Added documentation link for API key creation instructions
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/apps/human-app/frontend/src/shared/i18n/en.json | Added translation key for API key documentation link |
| packages/apps/human-app/frontend/src/modules/worker/profile/components/staking-info.tsx | Fixed staking validation logic, added error notifications, and included documentation link |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| useEffect(() => { | ||
| const stakingSummaryError = | ||
| stakingSummary?.on_chain_error || stakingSummary?.exchange_error; | ||
| if (stakingSummaryError && !isLoading && !isRefetching) { | ||
| showNotification({ | ||
| type: TopNotificationType.WARNING, | ||
| message: stakingSummaryError, | ||
| }); | ||
| } | ||
| }, [ |
There was a problem hiding this comment.
The notification will be shown every time the component re-renders if the error persists, potentially spamming the user. Consider adding stakingSummaryError or a ref to track whether the notification has already been shown for the current error.
There was a problem hiding this comment.
@github-copilot are you sure on the above? There is a if inside of effect callback that ensures notification shown only once, because isLoading, isRefetching and stakingSummary are updated at once
packages/apps/human-app/frontend/src/modules/worker/profile/components/staking-info.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/apps/human-app/frontend/src/modules/worker/profile/components/staking-info.tsx
Show resolved
Hide resolved
bfd2176 to
4ff6f0e
Compare
Issue tracking
Closes #3751 and #3747
Context behind the change
Fixed the logic conflict on profile page, where users get blocked due to onchain or exchange api key error even though they have staked enough.
Also added a link to the staking docs
How has this been tested?
locally mocking server response
Release plan
regular
Potential risks; What to monitor; Rollback plan
not found