Skip to content
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

Update the referral mechanism #886

Merged
merged 8 commits into from
Nov 26, 2024
Merged

Update the referral mechanism #886

merged 8 commits into from
Nov 26, 2024

Conversation

r-czajkowski
Copy link
Contributor

Closes: #876

Detect the referral code in the main router loader instead of the hooks. Using a router loader is simpler and we avoid race between two hooks useDetectEmbed and useDetectReferral.

We noticed a bug with hooks implementation - acre.referral set to 0 for Ledger Live after clearing local storage. The acre.referral key should always be set to 2083 value for users using Acre in Ledger Live.

Detect the referral code in the main router loader instead of the hooks.
Using a router loader is simpler and we avoid race between two hooks
`useDetectEmbed` and `useDetectReferral`.

We noticed a bug with hooks implementation - `acre.referral` set to `0`
for Ledger Live after clearing local storage. The `acre.referral` key
should always be set to `2083` value for users using Acre in Ledger
Live.
Copy link

netlify bot commented Nov 20, 2024

Deploy Preview for acre-dapp ready!

Name Link
🔨 Latest commit 80b0eab
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp/deploys/6745ec02a94d520009c41dad
😎 Deploy Preview https://deploy-preview-886--acre-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 20, 2024

Deploy Preview for acre-dapp-testnet ready!

Name Link
🔨 Latest commit 80b0eab
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp-testnet/deploys/6745ec0208a2670008997127
😎 Deploy Preview https://deploy-preview-886--acre-dapp-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@kkosiorowska kkosiorowska left a comment

Choose a reason for hiding this comment

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

Overall it looks good. I have only one comment.

I tested the referral in the standalone dApp, then removed it from URL. The value has not been reset. I think that in such a case we should back to the default value.
Screenshot 2024-11-21 at 14 29 01

Screenshot 2024-11-21 at 14 29 21

If there is no `ref` query param in URL. In that case we should back to
the default value.
@r-czajkowski
Copy link
Contributor Author

Overall it looks good. I have only one comment.

I tested the referral in the standalone dApp, then removed it from URL. The value has not been reset. I think that in such a case we should back to the default value. Screenshot 2024-11-21 at 14 29 01
Screenshot 2024-11-21 at 14 29 21

ac31173

r-czajkowski and others added 2 commits November 22, 2024 15:37
Handle a case when someone passes invalid referral code via URL. We should
set the default value in local storage instaed of using the previous
one.
r-czajkowski and others added 2 commits November 25, 2024 11:01
@kkosiorowska kkosiorowska merged commit 18b5373 into main Nov 26, 2024
26 of 28 checks passed
@kkosiorowska kkosiorowska deleted the fix-referral-mechanism branch November 26, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

acre.referral set to 0 for Ledger Live after clearing local storage
2 participants