Conversation
There was a problem hiding this comment.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Status |
|---|---|---|
| Non-Optimized Async Operations ▹ view | ✅ Fix detected | |
| Non-unique AsyncStorage Key for User Referrals ▹ view | ✅ Fix detected |
Files scanned
| File Path | Reviewed |
|---|---|
| src/pages/gd/Claim/OldClaim.tsx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
| return false | ||
| } | ||
|
|
||
| const isDivviDone = await AsyncStorage.getItem('GD_divvi') |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Comment on lines
+139
to
+142
| if (!isDivviDone) { | ||
| await AsyncStorage.setItem('GD_divvi', 'true') | ||
| await submitReferral({ txHash: claim.transactionHash, chainId }) | ||
| } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
15 tasks
There was a problem hiding this comment.
Hey @L03TJ3 - I've reviewed your changes - here's some feedback:
- Use a per-user key (e.g. include wallet address and chainId) when storing
GD_divviin AsyncStorage to avoid sending referrals across different accounts. - Wrap
submitReferral(and the AsyncStorage calls) in a try/catch so any errors won’t break or delay the claim flow.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
sirpy
requested changes
May 20, 2025
|
|
||
| if (!isDivviDone && chainId === 42220) { | ||
| await AsyncStorage.setItem('GD_divvi', 'true') | ||
| await submitReferral({ txHash: claim.transactionHash, chainId }) |
Contributor
There was a problem hiding this comment.
use my convention for submitReferral
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds referral submission after succesful claim on celo
About # (link your issue here)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist:
Description by Korbit AI
What change is being made?
Add divvi referral submission to the claim functionality in
OldClaim.tsxby incorporating thesubmitReferralmethod and updating the logic to store referral submission status inAsyncStorage.Why are these changes being made?
This change introduces a referral submission feature specifically for the network chainId 42220, enhancing user engagement through referrals. By storing the status in
AsyncStorage, the system ensures that the referral is submitted only once per user, preventing redundancy and potential errors during the referral process.