Skip to content

Commit

Permalink
fix(LIVE-1257): if user has a password to bypass onboarding check
Browse files Browse the repository at this point in the history
  • Loading branch information
KVNLS committed May 15, 2024
1 parent cfb5d27 commit cf435fd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-dolls-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

Fix LIVE-12571 where some users can't unlock LLD when they have set up a password
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useFeature } from "@ledgerhq/live-common/featureFlags/index";
import { saveSettings } from "~/renderer/actions/settings";
import { useDispatch, useSelector } from "react-redux";
import { useLocation } from "react-router-dom";
import { isLocked as isLockedSelector } from "~/renderer/reducers/application";
import { hasCompletedOnboardingSelector } from "~/renderer/reducers/settings";
import { useCustomPath } from "@ledgerhq/live-common/hooks/recoverFeatureFlag";

Expand All @@ -13,6 +14,7 @@ const ONBOARDED_VIA_RECOVER_RESTORE_USER_PREFIX = "ONBOARDED_VIA_RECOVER_RESTORE
export const useRecoverRestoreOnboarding = (seedPathStatus?: string) => {
const { pathname } = useLocation();
const dispatch = useDispatch();
const isLocked = useSelector(isLockedSelector);
const recoverServices = useFeature("protectServicesDesktop");
const recoverStoreId = recoverServices?.params?.protectId ?? "";
const hasCompletedOnboarding = useSelector(hasCompletedOnboardingSelector);
Expand All @@ -29,13 +31,14 @@ export const useRecoverRestoreOnboarding = (seedPathStatus?: string) => {
const hasCompletedOnboardingViaRestore = status === "true";

setOnboardedViaRecoverRestore(hasCompletedOnboardingViaRestore);

dispatch(
saveSettings({
hasCompletedOnboarding: onboardedViaRecoverRestore,
}),
);
}, [dispatch, onboardedViaRecoverRestore, recoverStoreId]);
if (!isLocked) {
dispatch(
saveSettings({
hasCompletedOnboarding: onboardedViaRecoverRestore,
}),
);
}
}, [dispatch, isLocked, onboardedViaRecoverRestore, recoverStoreId]);

useEffect(() => {
const userIsOnboardingOrSettingUp =
Expand Down

0 comments on commit cf435fd

Please sign in to comment.