Skip to content

Commit

Permalink
Live 15092 card create ledgerlive card deeplink to send user to the c…
Browse files Browse the repository at this point in the history
…ard live app (#8538)

* feat: add ledgerlive://card deeplink

* chore: add changeset
  • Loading branch information
sergiubreban authored Dec 2, 2024
1 parent aca3aeb commit f6eefe9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/cyan-singers-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ledger-live-desktop": patch
"live-mobile": patch
---

enable /card deeplink
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useStorylyContext } from "~/storyly/StorylyProvider";
import { useNavigateToPostOnboardingHubCallback } from "~/renderer/components/PostOnboardingHub/logic/useNavigateToPostOnboardingHubCallback";
import { usePostOnboardingDeeplinkHandler } from "@ledgerhq/live-common/postOnboarding/hooks/index";
import { setDrawerVisibility as setLedgerSyncDrawerVisibility } from "~/renderer/actions/walletSync";
import { WC_ID } from "@ledgerhq/live-common/wallet-api/constants";
import { CARD_APP_ID, WC_ID } from "@ledgerhq/live-common/wallet-api/constants";
import { getAccountsOrSubAccountsByCurrency, trackDeeplinkingEvent } from "./utils";
import { Currency } from "@ledgerhq/types-cryptoassets";

Expand Down Expand Up @@ -294,9 +294,14 @@ export function useDeepLinkHandler() {
}
break;
}
case "card":
navigate("/card", query);
break;
case "discover":
if (path?.startsWith("protect")) {
navigate(`/recover/${path}`, undefined, search);
} else if (path === CARD_APP_ID) {
navigate("/card", query);
} else {
navigate(`/platform/${path ?? ""}`, query);
}
Expand Down
7 changes: 6 additions & 1 deletion apps/ledger-live-mobile/src/navigation/DeeplinksProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ const linkingOptions = () => ({
* ie: "ledgerlive://discover/paraswap?theme=light" will open the catalog and the paraswap dapp with a light theme as parameter
*/
[ScreenName.PlatformApp]: "discover/:platform",
[NavigatorName.Card]: {
initialRouteName: ScreenName.Card,
screens: {
[ScreenName.Card]: "card",
},
},
[ScreenName.Recover]: "recover/:platform",
[NavigatorName.Main]: {
initialRouteName: ScreenName.Portfolio,
Expand Down Expand Up @@ -495,7 +501,6 @@ export const DeeplinksProvider = ({
const url = new URL(`ledgerlive://${path}`);
const { hostname, searchParams, pathname } = url;
const query = Object.fromEntries(searchParams);

const {
ajs_prop_campaign: ajsPropCampaign,
ajs_prop_track_data: ajsPropTrackData,
Expand Down

0 comments on commit f6eefe9

Please sign in to comment.