Skip to content

Commit

Permalink
Merge pull request #7872 from LedgerHQ/bugfix/wallet-api-llm-open-any…
Browse files Browse the repository at this point in the history
…-deeplink

fix(wallet-api): open any deep-link from the webview on LLM
  • Loading branch information
Justkant authored Sep 26, 2024
2 parents bb822fa + 7eb4f48 commit ecb8f3f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .changeset/tough-terms-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"live-mobile": patch
---

fix(wallet-api): open any deep-link from the webview on LLM

Needed for wallet-connect-live-app deep-link back to mobile dApps
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,9 @@ export const PlatformAPIWebview = forwardRef<WebviewAPI, WebviewProps>(

const onOpenWindow = useCallback((event: WebViewOpenWindowEvent) => {
const { targetUrl } = event.nativeEvent;
Linking.canOpenURL(targetUrl).then(supported => {
if (supported) {
Linking.openURL(targetUrl);
} else {
console.error(`Don't know how to open URI: ${targetUrl}`);
}
});
// Don't use canOpenURL as we cannot check unknown apps on the phone
// Without listing everything in plist and android manifest
Linking.openURL(targetUrl);
}, []);

useEffect(() => {
Expand Down
10 changes: 3 additions & 7 deletions apps/ledger-live-mobile/src/components/Web3AppWebview/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,9 @@ export function useWebView(

const onOpenWindow = useCallback((event: WebViewOpenWindowEvent) => {
const { targetUrl } = event.nativeEvent;
Linking.canOpenURL(targetUrl).then(supported => {
if (supported) {
Linking.openURL(targetUrl);
} else {
console.error(`Don't know how to open URI: ${targetUrl}`);
}
});
// Don't use canOpenURL as we cannot check unknown apps on the phone
// Without listing everything in plist and android manifest
Linking.openURL(targetUrl);
}, []);

return {
Expand Down

0 comments on commit ecb8f3f

Please sign in to comment.