Skip to content

Commit

Permalink
feat: 💄 Update Sync flow LedgerSync (#7854)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcayuelas-ledger authored Sep 19, 2024
1 parent 5e4272d commit 45a27dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-lamps-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

Block users from syncing with device if Ledger Sync is active on instance
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { ErrorReason } from "LLM/features/WalletSync/hooks/useSpecificError";
import { useCurrentStep } from "LLM/features/WalletSync/hooks/useCurrentStep";
import ScannedInvalidQrCode from "~/newArch/features/WalletSync/screens/Synchronize/ScannedInvalidQrCode";
import ScannedOldImportQrCode from "~/newArch/features/WalletSync/screens/Synchronize/ScannedOldImportQrCode";
import { useSelector } from "react-redux";
import { trustchainSelector } from "@ledgerhq/trustchain/store";

type Props = {
currency?: CryptoCurrency | TokenCurrency | null;
Expand Down Expand Up @@ -47,6 +49,7 @@ const StepFlow = ({
}: Props) => {
const { currentStep, setCurrentStep } = useCurrentStep();
const { memberCredentials } = useInitMemberCredentials();
const trustchain = useSelector(trustchainSelector);

const { handleStart, handleSendDigits, inputCallback, nbDigits } = useSyncWithQrCode();

Expand All @@ -68,7 +71,9 @@ const StepFlow = ({
<SelectAddAccountMethod
doesNotHaveAccount={doesNotHaveAccount}
currency={currency}
setWalletSyncDrawerVisible={navigateToChooseSyncMethod}
setWalletSyncDrawerVisible={
trustchain?.rootId ? navigateToQrCodeMethod : navigateToChooseSyncMethod
}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const WalletSyncManage = () => {

const manageKeyHook = useManageKeyDrawer();
const manageInstancesHook = useManageInstancesDrawer();

const { error: ledgerSyncError, isError: isLedgerSyncError } = useLedgerSyncStatus();

const {
Expand Down Expand Up @@ -168,7 +167,7 @@ const WalletSyncManage = () => {
</InstancesRow>

<ActivationDrawer
startingStep={Steps.ChooseSyncMethod}
startingStep={Steps.QrCodeMethod}
isOpen={isSyncDrawerOpen}
handleClose={closeSyncDrawer}
/>
Expand Down

0 comments on commit 45a27dc

Please sign in to comment.