Skip to content

Commit 5567fd2

Browse files
feat(LIVE-19638): send where user clicked from to swap live app
1 parent 390d87a commit 5567fd2

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

.changeset/gorgeous-weeks-stare.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"ledger-live-desktop": minor
3+
"live-mobile": minor
4+
---
5+
6+
add where user clicked swap from

apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/SwapWebViewDemo3.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import {
5454
} from "../utils/index";
5555
import FeesDrawerLiveApp from "./FeesDrawerLiveApp";
5656
import WebviewErrorDrawer from "./WebviewErrorDrawer/index";
57+
import { currentRouteNameRef } from "~/renderer/analytics/screenRefs";
5758

5859
export class UnableToLoadSwapLiveError extends Error {
5960
constructor(message: string) {
@@ -506,6 +507,7 @@ const SwapWebView = ({ manifest }: SwapWebProps) => {
506507
<Web3AppWebview
507508
manifest={manifestWithHash}
508509
inputs={{
510+
source: currentRouteNameRef.current || "",
509511
theme: themeType,
510512
lang: locale,
511513
currencyTicker: fiatCurrency.ticker,

apps/ledger-live-mobile/src/screens/Swap/LiveApp/WebView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { useDispatch } from "react-redux";
2222
import { useTranslateToSwapAccount } from "./hooks/useTranslateToSwapAccount";
2323
import { flattenAccountsSelector } from "~/reducers/accounts";
2424
import { useSwapCustomHandlers } from "./customHandlers";
25+
import { currentRouteNameRef } from "~/analytics/screenRefs";
2526

2627
type Props = {
2728
manifest: LiveAppManifest;
@@ -59,6 +60,7 @@ export function WebView({ manifest, params, setWebviewState }: Props) {
5960
customHandlers={customHandlers}
6061
onStateChange={setWebviewState}
6162
inputs={{
63+
source: currentRouteNameRef.current || "",
6264
swapApiBase: SWAP_API_BASE,
6365
swapUserIp: SWAP_USER_IP,
6466
devMode,

0 commit comments

Comments
 (0)