Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cool-socks-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

fix: double trigger of recover upsell navigation
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,10 @@ function useRedirectToPortfolio({
useCase: OnboardingUseCase;
}) {
const redirectToPostOnboarding = useRedirectToPostOnboardingCallback();
const hasRedirected = useRef(false);
useEffect(() => {
if (enabled) {
if (enabled && !hasRedirected.current) {
hasRedirected.current = true;
/**
* There is a lag if we call navigate("/") directly.
* To improve the UX in that situation, we have to first commit a "loading"
Expand Down Expand Up @@ -358,6 +360,9 @@ export default function Tutorial({ useCase, deviceModelId }: Props) {

const dispatch = useDispatch();

console.log("onboardingDone", onboardingDone);
console.log("useCase", useCase);

Comment on lines +363 to +365
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
console.log("onboardingDone", onboardingDone);
console.log("useCase", useCase);

useRedirectToPortfolio({
enabled: onboardingDone,
useCase,
Expand Down Expand Up @@ -396,6 +401,7 @@ export default function Tutorial({ useCase, deviceModelId }: Props) {
dispatch(setHasRedirectedToPostOnboarding(false));
dispatch(setHasBeenUpsoldRecover(false));
track("Onboarding - End", trackProperties);

setOnboardingDone(true);
}, [dispatch, connectedDevice, useCase, trackProperties]);

Expand Down
Loading