-
Notifications
You must be signed in to change notification settings - Fork 327
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
fix(LIVE-9486): add specific featureFlags deeplinks tutorial #5027
fix(LIVE-9486): add specific featureFlags deeplinks tutorial #5027
Conversation
🦋 Changeset detectedLatest commit: 843834a The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Ignored Deployments
|
7c81fa4
to
2d776a8
Compare
const search = `?${page ? `redirectTo=${page}` : ""}${page && source ? "&" : ""}${ | ||
source ? `source=${source}` : "" | ||
}`; |
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.
You might want to use URLSearchParams
and call .toString()
on it instead of constructing by hand the different variant
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.
} else if (useCase === UseCase.recoveryPhrase && postOnboardingPath) { | ||
history.push(postOnboardingPath); | ||
} else if (useCase === UseCase.connectDevice && devicePairingPath) { | ||
history.push(devicePairingPath); |
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.
Was that added to move to different "route" if you end the onboarding in different screens ?
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.
Yes it's done on liveApp
The links are update on featureflags protectServiceDesktop (dev).
We need to wait next release to update FF staging and prod
There is all routes params for deeplinks_clicked events
We need to send this with the LiveApp to have the good UserID of Recover
…:LedgerHQ/ledger-live into bugfix/deeplink-redirection-tracking-lld
…:LedgerHQ/ledger-live into bugfix/deeplink-redirection-tracking-lld
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.
Small change I would do
const [basicUri] = modelUri ? modelUri.split("?") : []; | ||
const uri = new URL(basicUri); | ||
|
||
if (page) uri.searchParams.append("redirectTo", page); | ||
if (source) uri.searchParams.append("source", source); | ||
if (source && deeplinkCampaign) { | ||
uri.searchParams.append("ajs_recover_source", source); | ||
uri.searchParams.append("ajs_recover_campaign", deeplinkCampaign); | ||
} |
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 about the cost of creating an URL and appending to it but I would memo that part
const [basicUri] = modelUri ? modelUri.split("?") : []; | |
const uri = new URL(basicUri); | |
if (page) uri.searchParams.append("redirectTo", page); | |
if (source) uri.searchParams.append("source", source); | |
if (source && deeplinkCampaign) { | |
uri.searchParams.append("ajs_recover_source", source); | |
uri.searchParams.append("ajs_recover_campaign", deeplinkCampaign); | |
} | |
const uri = useMemo(() => { | |
const [basicUri] = modelUri ? modelUri.split("?") : []; | |
const uri = new URL(basicUri); | |
if (page) uri.searchParams.append("redirectTo", page); | |
if (source) uri.searchParams.append("source", source); | |
if (source && deeplinkCampaign) { | |
uri.searchParams.append("ajs_recover_source", source); | |
uri.searchParams.append("ajs_recover_campaign", deeplinkCampaign); | |
} | |
return uri; | |
}, [deeplinkCampaign, modelUri, page, source]); |
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.
📝 Description
❓ Context
ledger-live-desktop
,live-common
,types-live
✅ Checklist
📸 Demo
🚀 Expectations to reach
Please make sure you follow these Important Steps.
Pull Requests must pass the CI and be internally validated in order to be merged.