Skip to content

Commit

Permalink
feat: 💄 Update Copy of LedgerSync (#7853)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcayuelas-ledger authored Sep 20, 2024
1 parent dedaec3 commit 2fd05ea
Show file tree
Hide file tree
Showing 21 changed files with 163 additions and 108 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-goats-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

Update Copy of LedgerSync
117 changes: 60 additions & 57 deletions apps/ledger-live-mobile/src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1396,10 +1396,10 @@
},
"welcomeBackStep": {
"title": "Welcome back",
"subtitle": "Select how you’d like to access your wallet:",
"subtitle": "Tell us how you prefer to access your wallet:",
"connect": "Connect your Ledger",
"sync": "Sync with Ledger Live desktop",
"walletSync": "Sync with another Ledger Live app"
"walletSync": "Use Ledger Sync"
},
"discoverLive": {
"exploreWithoutADevice": "Explore without a device",
Expand Down Expand Up @@ -2361,12 +2361,11 @@
"description": "Import asset from Ledger Live Desktop"
},
"add": {
"title": "Add with your Ledger",
"description": "Create or import your assets using your Ledger device"
"title": "Use your Ledger device",
"description": "Create or import your crypto account using your Ledger device"
},
"walletSync": {
"title": "Import via another Ledger Live app",
"description": "Activate Ledger Sync"
"title": "Use Ledger Sync"
}
}
},
Expand Down Expand Up @@ -2806,7 +2805,7 @@
"dateFormat": "Date format",
"dateFormatDesc": "Set the date format for Ledger Live",
"walletSync": "Ledger Sync",
"walletSyncDesc": "Securely sync your accounts across multiple Ledger Live instances",
"walletSyncDesc": "Sync your Ledger Live crypto accounts across different phones and computers.",
"region": "Region",
"regionDesc": "Choose your region to update formats of dates, time and currencies.",
"password": "App lock",
Expand Down Expand Up @@ -6759,15 +6758,15 @@
"title": "Ledger Sync",
"activation": {
"screen": {
"title": "Sync your accounts across all platforms",
"description": "Your Ledger will generate an encryption key, ensuring your data remains private and retrievable only by you.",
"mainCta": "Sync your accounts",
"secondCta": "Already synced a Ledger Live app?",
"learnMore": "Learn More"
"title": "Turn on Ledger Sync for this phone?",
"description": "This automatically syncs your crypto accounts across all your phones and computers, even when transitioning to a new device.",
"mainCta": "Turn on Ledger Sync",
"secondCta": "I already turned it on",
"learnMore": "How does Ledger Sync work?"
}
},
"deviceSelection": {
"title": "Choose the Ledger device you will use to secure your backup",
"title": "Choose your Ledger device",
"description": "You can retrieve your backup by simply connecting your Ledger to the Ledger Live mobile and desktop apps."
},
"deviceAction": {
Expand All @@ -6780,17 +6779,16 @@
"synch": "We are updating the synched instances..."
},
"success": {
"sync": "Synchronization successful!",
"syncDesc": "Changes in your accounts will now automatically appear across all apps and platforms.",
"activation": "Success!",
"activationDesc": "You successfully enabled Ledger Sync.",
"sync": "Sync successful",
"syncDesc": "Changes in your crypto accounts will now automatically appear across Ledger Live apps on synched phones and computers.",
"activation": "Ledger Sync turned on for Ledger Live on this phone",
"syncAnother": "Sync with another Ledger Live app",
"close": "Close"
},
"walletSyncActivated": {
"synchronize": {
"title": "Synchronize",
"description": "Synchronize your accounts with another Ledger Live app for a seamless experience."
"title": "Sync with another Ledger Live app",
"description": "Sync your Ledger Live crypto accounts across different phones and computers."
},
"manageKey": {
"title": "Delete Sync",
Expand All @@ -6805,33 +6803,32 @@
}
},
"manageInstances": {
"title": "Manage synchronized instances",
"title": "Ledger Live is synched across:",
"remove": "Remove"
},
"synchronizedInstances": {
"cta": "Manage now",
"title": "{{count}} Synchronized Instance",
"title_plural": "{{count}} Synchronized Instances",
"cta": "Manage",
"title": "{{count}} Ledger Live app synched",
"title_plural": "{{count}} Ledger Live apps synched",
"error": "Instances",
"unsecuredError": {
"title": "The synchronization isn't secured by this Ledger",
"description": "Please connect the Ledger device you used to create your encryption key.",
"info": "If you have lost your Ledger, don't worry! You can still delete your key. This action will simultaneously delete your data and unsynchronize all currently synced instances.",
"title": "Connect the same Ledger device you used for enabling Ledger Sync",
"description": "If you don’t have the same Ledger device, select “Delete sync”.",
"cta": "Connect another Ledger",
"ctaDelete": "Delete my encryption key"
"ctaDelete": "Delete sync"
},
"autoRemoveError": {
"title": "You can’t remove the current instance",
"description": "For security reasons, you cannot remove the instance you are currently using without deleting your encryption key.",
"title": "You can’t remove this phone while you’re using it",
"description": "To remove, use another phone or computer with Ledger Sync enabled. If you don’t have another device, select 'Delete sync'.",
"info": "Deleting your encryption key will result in your devices becoming unsynchronized, and all synchronized data will be deleted. However, this will not affect your funds. You can resync your accounts at any time.",
"cta": "I understand",
"ctaDelete": "Delete my encryption key"
"ctaDelete": "Delete sync"
},
"success": "Your {{member}} is no longer synchronized"
"success": "Your Ledger Live app on {{member}} is no longer connected to Ledger Sync"
},
"errors": {
"fetching": "Something went wrong while fetching your synchronized instances.",
"ledgerSyncUnavailable": "Ledger Sync is currently unavailable. This doesn’t have any impact on your assets."
"ledgerSyncUnavailable": "Ledger Sync is temporarily unavailable due to some technical issues on our end. We’re working on fixing it."
}
},
"synchronize": {
Expand All @@ -6845,14 +6842,14 @@
}
},
"qrCode": {
"title": "Synchronize Instances",
"title": "Sync Ledger Live apps",
"show": {
"title": "Show QR",
"explanation": {
"title": "Scan and synchronize your accounts using another Ledger Live app",
"steps": {
"step1": "Open the Ledger Live app you want to sync",
"step2": "Go to <0>Settings</0> <1>></1> <0>General</0> <1>></1> <0>Ledger Sync</0> <1>></1> <0>Synchronize</0>",
"step2": "Go to <0>Settings</0> <1>></1> <0>General</0> <1>></1> <0>Ledger Sync</0> <1>></1> <0>Turn on Ledger Sync</0> <1>></1> <0>Scan QR code</0>",
"step3": "Scan QR code"
}
}
Expand All @@ -6861,57 +6858,63 @@
"title": "Scan",
"description": "Scan QR code",
"explanation": {
"title": "Scan and synchronize your accounts using another Ledger Live app",
"title": "To sync with Ledger Live on another phone or computer...",
"steps": {
"step1": "Open the Ledger Live app you want to sync",
"step2": "Go to <0>Settings</0> <1>></1> <0>General</0> <1>></1> <0>Ledger Sync</0> <1>></1> <0>Synchronize</0> <1>></1> <0>Show QR</0>",
"step1": "Open the Ledger Live you want to sync with.",
"step2": "Go to <0>Settings</0> <1>></1> <0>General</0> <1>></1> <0>Ledger Sync</0> <1>></1> <0>Turn on Ledger Sync</0> <1>></1> <0>Show QR</0>",
"step3": "Scan QR code"
}
}
},
"pinCode": {
"title": "Enter your code",
"desc": "Type the code displayed on the Ledger Live you want to sync with.",
"title": "Enter Ledger Sync code",
"desc": "Enter the code shown on your computer to sync your crypto accounts across both apps.",
"error": {
"title": "Codes do not match",
"title": "The codes don’t match",
"desc": "Make sure the code you type is the one displayed on the other Ledger Live instance.",
"tryAgain": "Try again"
}
},
"scannedInvalidQrCode": {
"title": "Invalid QR Code",
"desc": "It looks like the QR code you scanned isn't valid. Please try again with a Ledger Sync valid QR code.",
"tryAgain": "Try again"
"desc": "Only scan the QR code displayed on Ledger Live for synching your Ledger Live apps.",
"info": "For the QR code, open “Settings”, select “General”, and then select “Ledger Sync”, “Turn on sync” and “Show QR”.",
"cta": "I understand"
},
"scannedOldQrCode": {
"title": "Update required",
"desc": "To sync your apps, please make sure both are updated to the latest version.",
"tryAgain": "Try again"
"title": "Ledger Live update required",
"desc": "To continue with sync, update the Ledger Live app that’s not up to date.",
"info": "For more on how to update, <0>check out this article<0>.",
"cta": "I understand"
},
"unbacked": {
"title": "You need to create your encryption key first",
"description": "Please make sure you’ve created an encryption key on one of your Ledger Live apps before continuing your synchronization.",
"cta": "Create your encryption key"
"title": "Sync not detected",
"description": "Turn on Ledger Sync on either this Ledger Live or the one you're syncing with.",
"cta": "Turn on Ledger Sync"
},
"unbackedOnboarding": {
"title": "No backup detected",
"description": "Secure your other app with a Ledger then try again or continue your onboarding",
"title": "Sync not detected",
"description": "Come back here after you turn on sync for the other Ledger Live app, and then select “Try again”.",
"info": "If Ledger Sync is not enabled anywhere, then continue without it.",
"cta": "Try again",
"cancel": "Continue without sync"
},
"backedWithDifferentSeeds": {
"title": "These apps have different backups",
"description": "Delete your encryption key from one of the apps and try again",
"title": "Different Ledger devices were used to enable Ledger Sync on each app",
"description": "To sync the two Ledger Live apps, you need to use the same Ledger device.",
"info": "To fix this, delete sync for one of the apps and turn it on again by scanning the QR code.",
"cta": "I understand"
},
"alreadyBacked": {
"title": "These apps are already secured by a Ledger",
"cta": "I understand"
"title": "Both Ledger Live apps are already synched",
"cta": "Got it"
}
},
"unbackedOnboarding": {
"title": "This Ledger doesn’t secure a backup",
"cta": "Try another Ledger",
"title": "Sync not detected",
"description": "If Ledger Sync is enabled, select “Try again” and make sure to connect the same Ledger device you used for enabling it.",
"info": "Or, continue without Ledger Sync.",
"cta": "Try again",
"cancel": "Continue without sync"
},
"alreadySecureError": {
Expand Down Expand Up @@ -6968,4 +6971,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ describe("AddAccount", () => {
});
// Wait for the drawer to open
await expect(await screen.findByText(/add another account/i));
await expect(await screen.findByText(/add with your ledger/i));
await expect(await screen.findByText(/import via another ledger live app/i));
await expect(await screen.findByText(/Use your Ledger device/i));
await expect(await screen.findByText(/Use Ledger Sync/i));
// On press add with another ledger live app
await act(async () => {
await user.press(await screen.getByText(/add with your ledger/i));
await user.press(await screen.getByText(/Use your Ledger device/i));
});
await expect(await screen.findByText(/crypto asset/i)).toBeVisible();
// On click back
Expand Down Expand Up @@ -88,11 +88,11 @@ describe("AddAccount", () => {
});
// Wait for the drawer to open
await expect(await screen.findByText(/add another account/i));
await expect(await screen.findByText(/add with your ledger/i));
await expect(await screen.findByText(/import via another ledger live app/i));
await expect(await screen.findByText(/Use your Ledger device/i));
await expect(await screen.findByText(/Use Ledger Sync/i));
// On press add with wallet sync
await act(async () => {
await user.press(await screen.getByText(/import via another ledger live app/i));
await user.press(await screen.getByText(/Use Ledger Sync/i));
});
await expect(await screen.findByText(/choose your sync method/i)).toBeVisible();
await expect(await screen.findByText(/Scan a QR code/i));
Expand All @@ -118,7 +118,7 @@ describe("AddAccount", () => {
await user.press(addAssetButton);
// Wait for the drawer to open
await expect(await screen.findByText(/add another account/i));
await expect(await screen.findByText(/add with your ledger/i));
await expect(await screen.findByText(/Use your Ledger device/i));
await expect(await screen.findByText(/import from desktop/i));
// On press add from desktop
await user.press(await screen.getByText(/import from desktop/i));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ function View({
if (isWalletSyncEnabled) {
rows.push({
titleKey: "addAccountsModal.drawer.walletSync.title",
descriptionKey: "addAccountsModal.drawer.walletSync.description",
onPress: onClickImportLedgerSync,
icon: <Icons.QrCode color={"primary.c80"} />,
icon: <Icons.Refresh color={"primary.c80"} />,
testID: "add-accounts-modal-wallet-sync-button",
});
} else {
Expand All @@ -61,20 +60,18 @@ function View({

return (
<>
<Text variant="h4" fontWeight="semiBold" fontSize="24px" mb={16}>
<Text variant="h4" fontWeight="semiBold" fontSize="24px" mb="32px">
{doesNotHaveAccount
? t("addAccountsModal.title")
: t("addAccountsModal.drawer.drawerTitleHasAccount")}
</Text>
<Text variant="large" fontWeight="medium" fontSize="14px" color="neutral.c70" mb="32px">
{t("addAccountsModal.drawer.drawerSubTitle")}
</Text>

<Flex flexDirection="column" rowGap={16}>
{rows.map((row, index) => (
<ActionRow
key={index}
title={t(row.titleKey)}
description={t(row.descriptionKey)}
description={t(row.descriptionKey ?? "")}
onPress={row.onPress}
icon={row.icon}
testID={row.testID}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ describe("ManageInstances", () => {
await user.press(await screen.findByText(/ledger sync/i));

//Manage Instances Flow
expect(await screen.findByText(/2 Synchronized Instances/i)).toBeVisible();
expect(await screen.findByText(/2 Ledger Live apps synched/i)).toBeVisible();

await user.press(await screen.findByText(/Manage now/i));
await user.press(await screen.findByText(/Manage/i));

expect(await screen.findByText(/Manage synchronized instances/i)).toBeVisible();
expect(await screen.findByText(/Ledger Live is synched across/i)).toBeVisible();

expect(await screen.findByText(INSTANCES[0].name)).toBeVisible();
expect(await screen.findByText(INSTANCES[1].name)).toBeVisible();
Expand Down Expand Up @@ -99,11 +99,11 @@ describe("ManageInstances", () => {
await user.press(await screen.findByText(/ledger sync/i));

//Manage Instances Flow
expect(await screen.findByText(/2 Synchronized Instances/i)).toBeVisible();
expect(await screen.findByText(/2 Ledger Live apps synched/i)).toBeVisible();

await user.press(await screen.findByText(/Manage now/i));
await user.press(await screen.findByText(/Manage/i));

expect(await screen.findByText(/Manage synchronized instances/i)).toBeVisible();
expect(await screen.findByText(/Ledger Live is synched across/i)).toBeVisible();

expect(await screen.findByText(INSTANCES[0].name)).toBeVisible();
expect(await screen.findByText(INSTANCES[1].name)).toBeVisible();
Expand All @@ -114,7 +114,7 @@ describe("ManageInstances", () => {
await user.press(screen.getAllByText("Remove")[0]);

// Auto remove check handled
expect(screen.getByText(/You can’t remove the current instance/i)).toBeDefined();
expect(screen.getByText(/You can’t remove this phone while you’re using it/i)).toBeDefined();

await user.press(await screen.findByText(/I understand/i));

Expand Down Expand Up @@ -142,10 +142,10 @@ describe("ManageInstances", () => {
});

await user.press(await screen.findByText(/ledger sync/i));
await user.press(await screen.findByText(/Manage now/i));
await user.press(await screen.findByText(/Manage/i));
await user.press(screen.getAllByText("Remove")[0]);
expect(screen.getByText(/You can’t remove the current instance/i)).toBeDefined();
await user.press(await screen.findByText(/Delete my encryption key/i));
expect(screen.getByText(/You can’t remove this phone while you’re using it/i)).toBeDefined();
await user.press(await screen.getByTestId("ctaSecondary-detailled-error"));
await waitFor(() => screen.findByText(/Sure you want delete sync?/i));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("scanQRCode", () => {
overrideInitialState: INITIAL_TEST,
});
await user.press(await screen.findByText(/ledger sync/i));
await user.press(await screen.findByText(/Already synced a Ledger Live app?/i));
await user.press(await screen.findByText(/I already turned it on/i));
await user.press(await screen.findByText(/scan a qr code/i));
await expect(screen.queryAllByText(/show qr/i)).toHaveLength(2);
await expect(screen.getByTestId("ws-scan-camera")).toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe("SynchronizeWithQrCode", () => {
overrideInitialState: INITIAL_TEST,
});
await user.press(await screen.findByText(/ledger sync/i));
await user.press(await screen.findByText(/Already synced a Ledger Live app?/i));
await user.press(await screen.findByText(/I already turned it on/i));
await user.press(await screen.findByText(/scan a qr code/i));
await user.press(await screen.queryAllByText(/show qr/i)[0]);
expect(await screen.getByTestId("ws-qr-code-displayed")).toBeVisible();
Expand All @@ -36,7 +36,7 @@ describe("SynchronizeWithQrCode", () => {
// Need to wait 3 seconds to simulate the time taken to scan the QR code
setTimeout(async () => {
await waitFor(() => {
expect(screen.getByText("Enter the code")).toBeDefined();
expect(screen.getByText("Enter Ledger Sync code")).toBeDefined();
});
}, 3000);

Expand Down
Loading

0 comments on commit 2fd05ea

Please sign in to comment.