Skip to content

add: divvi referral submission#596

Merged
L03TJ3 merged 4 commits into
masterfrom
add-divvi
May 20, 2025
Merged

add: divvi referral submission#596
L03TJ3 merged 4 commits into
masterfrom
add-divvi

Conversation

@L03TJ3

@L03TJ3 L03TJ3 commented May 20, 2025

Copy link
Copy Markdown
Collaborator

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:

  • PR title matches follow: (Feature|Bug|Chore) Task Name
  • My code follows the style guidelines of this project
  • I have followed all the instructions described in the initial task (check Definitions of Done)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added reference to a related issue in the repository
  • I have added a detailed description of the changes proposed in the pull request. I am as descriptive as possible, assisting reviewers as much as possible.
  • I have added screenshots related to my pull request (for frontend tasks)
  • I have pasted a gif showing the feature.
  • @mentions of the person or team responsible for reviewing proposed changes

Description by Korbit AI

What change is being made?

Add divvi referral submission to the claim functionality in OldClaim.tsx by incorporating the submitReferral method and updating the logic to store referral submission status in AsyncStorage.

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.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@korbit-ai korbit-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Performance Non-Optimized Async Operations ▹ view ✅ Fix detected
Functionality 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.

Loving Korbit!? Share us on LinkedIn Reddit and X

return false
}

const isDivviDone = await AsyncStorage.getItem('GD_divvi')

This comment was marked as resolved.

Comment thread src/pages/gd/Claim/OldClaim.tsx Outdated
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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 20, 2025

Copy link
Copy Markdown

Deploying goodprotocolui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 232620e
Status:🚫  Build failed.

View logs

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_divvi in 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

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/pages/gd/Claim/OldClaim.tsx Outdated

if (!isDivviDone && chainId === 42220) {
await AsyncStorage.setItem('GD_divvi', 'true')
await submitReferral({ txHash: claim.transactionHash, chainId })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use my convention for submitReferral

@L03TJ3 L03TJ3 merged commit 6c8426d into master May 20, 2025
2 of 4 checks passed
@L03TJ3 L03TJ3 deleted the add-divvi branch May 20, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants