Skip to content

Commit

Permalink
Merge pull request #6175 from LedgerHQ/bugfix/LIVE-11270
Browse files Browse the repository at this point in the history
fix: LLD wallet connect deep link handling for requests [LIVE-11270]
  • Loading branch information
Justkant authored Feb 13, 2024
2 parents 964cbca + d16e6ea commit 3564208
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fair-adults-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

fix: LLD wallet connect deeplink handling for requests [LIVE-11270]
13 changes: 12 additions & 1 deletion apps/ledger-live-desktop/src/renderer/hooks/useDeeplinking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,17 @@ export function useDeepLinkHandler() {
}
break;
case "wc": {
// Only prevent requests if already on the wallet connect live-app
if (location.pathname === "/platform/ledger-wallet-connect") {
try {
// Prevent a request from updating the live-app url and reloading it
if (query.uri && new URL(query.uri).searchParams.get("requestId")) {
return;
}
} catch {
// Fall back on navigation to the live-app in case of an invalid URL
}
}
setTrackingSource("deeplink");
navigate("/platform/ledger-wallet-connect", query);

Expand All @@ -329,7 +340,7 @@ export function useDeepLinkHandler() {
break;
}
},
[accounts, dispatch, navigate, setUrl],
[accounts, dispatch, location.pathname, navigate, setUrl],
);
return {
handler,
Expand Down

0 comments on commit 3564208

Please sign in to comment.