-
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
[LLM][PROTECT-3391/3392/3393/3401/3403] Auto redirection to Recover upsell at the end of Stax/Flex onboarding #8226
[LLM][PROTECT-3391/3392/3393/3401/3403] Auto redirection to Recover upsell at the end of Stax/Flex onboarding #8226
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Skipped Deployments
|
a909caa
to
0037020
Compare
0037020
to
4410996
Compare
4410996
to
e422f97
Compare
14249d9
to
98b4bb0
Compare
119771d
to
8f59261
Compare
8f59261
to
07016ab
Compare
07016ab
to
618e5b5
Compare
618e5b5
to
8a8dae5
Compare
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.
Some comments :)
apps/ledger-live-mobile/src/hooks/useAutoRedirectToPostOnboarding/index.ts
Outdated
Show resolved
Hide resolved
apps/ledger-live-mobile/src/hooks/useAutoRedirectToPostOnboarding/index.ts
Outdated
Show resolved
Hide resolved
apps/ledger-live-mobile/src/hooks/useAutoRedirectToPostOnboarding/index.ts
Outdated
Show resolved
Hide resolved
...edger-live-mobile/src/hooks/useAutoRedirectToPostOnboarding/useOpenPostOnboardingCallback.ts
Outdated
Show resolved
Hide resolved
...ledger-live-mobile/src/hooks/useAutoRedirectToPostOnboarding/useOpenProtectUpsellCallback.ts
Outdated
Show resolved
Hide resolved
8a8dae5
to
9caa863
Compare
9caa863
to
46fea4c
Compare
46fea4c
to
0cd92dd
Compare
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.
LGTM
|
||
function testScenarios(scenarios: Scenario[]) { | ||
scenarios.forEach(scenario => { | ||
it(`should return ${JSON.stringify(scenario.expected)} for ${JSON.stringify(scenario.device)} and feature flag enabled: ${scenario.featureFlagEnabled}`, () => { |
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.
[could] use it.each
syntax
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.
✅
039b446
0cd92dd
to
039b446
Compare
useEffect(() => { | ||
if (!isFocused) return; | ||
if (shouldRedirectToProtectUpsell) { | ||
openProtectUpsell(); | ||
} else if (shouldRedirectToPostOnboarding && lastConnectedDevice) { | ||
openPostOnboarding(lastConnectedDevice.modelId); | ||
} | ||
}, [ | ||
lastConnectedDevice, | ||
openPostOnboarding, | ||
openProtectUpsell, | ||
shouldRedirectToPostOnboarding, | ||
shouldRedirectToProtectUpsell, | ||
focused, | ||
isFocused, | ||
]); |
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.
I'm wondering if there is a risk of us calling again an open because isFocused
toggles when opening the first time and coming back to the screen using this hook
Edit: probably handled here I suppose https://github.com/LedgerHQ/ledger-live/pull/8226/files#diff-3f35818d8304ffbf87ae671eca670437cfc8eade2dfac067406cdb959ae5f496R37-R41
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.
Once the redirection to whatever is done, shouldRedirectToWhatever
will be false, so it won't trigger again 👍
✅ Checklist
npx changeset
was attached.recoverUpsellRedirection
deactivated, the onboarding flow is unchanged.recoverUpsellRedirection
activated, the "Backup for your Secret Recovery Phrase" step between Secret Recovery Phrase and Apps Installation will be hidden.recoverUpsellRedirection
deactivated, the post onboarding hub is opened immediately.recoverUpsellRedirection
activate, the Ledger Recover upsell is opened. When that upsell is dismissed, the user is redirected to the post onboarding hub.How to test:
0. Prerequisite for each test
Settings > Debug > Configuration
and press "Reset onboarding state".Settings > Debug > Configuration
& enable “Ledger Recover deeplinks environment”. This will ensure the URL Recover upsell is the production one, so it doesn't require any additional local setup (VPN etc.).Test 1.
recoverUpsellRedirection
FF enabledOnboarding Flex / Stax:
-> the "backup" step should not be in the sync onboarding.
-> at the end, it should open the Recover upsell.
-> when dismissing the Recover upsell, it should redirect to post onboarding.
Test 2.
recoverUpsellRedirection
FF disabledOnboarding Flex / Stax:
-> the "backup" setup should be in the sync onboarding.
-> at the end, it should open the post onboarding.
Test 3. Nano X onboarding (non reg)
Onboarding Nano X:
-> at the end, it should open the Recover upsell.
Test 4. Nano SP onboarding (non reg)
Onboarding Nano SP:
-> at the end, it should just go to the portfolio screen.
📝 Description
Cf. "impact of the changes".
I had to do some refactoring to have all the post onboarding & upsell auto redirection logic in one place (the portfolio screen) to ensure its robustness for all device models.
❓ Context
🧐 Checklist for the PR Reviewers