Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add privacy query params to portfolio navigation #25958

Merged
merged 23 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions test/e2e/tests/bridge/bridge-click-from-asset-overview.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import GanacheContractAddressRegistry from '../../seeder/ganache-contract-addres
import { Driver } from '../../webdriver/driver';
import { BridgePage, getBridgeFixtures } from './bridge-test-utils';

const EXPECTED_PORTFOLIO_URL =
'https://portfolio.metamask.io/bridge?metametricsId=null&metricsEnabled=false&marketingEnabled=false';
Comment on lines +8 to +9
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added EXPECTED_PORTFOLIO_URL constant to include new query parameters.


describe('Click bridge button from asset page @no-mmi', function (this: Suite) {
it('loads portfolio tab when flag is turned off', async function () {
await withFixtures(
Expand All @@ -25,18 +28,13 @@ describe('Click bridge button from asset page @no-mmi', function (this: Suite) {
// ETH
await bridgePage.loadAssetPage(contractRegistry);
await bridgePage.load('coin-overview');
await bridgePage.verifyPortfolioTab(
'https://portfolio.metamask.io/bridge?metametricsId=null',
);

await bridgePage.verifyPortfolioTab(EXPECTED_PORTFOLIO_URL);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Updated URL verification to include metricsEnabled and marketingEnabled query parameters.

await bridgePage.reloadHome();

// TST
await bridgePage.loadAssetPage(contractRegistry, 'TST');
await bridgePage.load('token-overview');
await bridgePage.verifyPortfolioTab(
'https://portfolio.metamask.io/bridge?metametricsId=null',
);
await bridgePage.verifyPortfolioTab(EXPECTED_PORTFOLIO_URL);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Updated URL verification to include metricsEnabled and marketingEnabled query parameters.

},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Click bridge button from wallet overview @no-mmi', function (this: Sui
await logInWithBalanceValidation(driver, ganacheServer);
await bridgePage.load();
await bridgePage.verifyPortfolioTab(
'https://portfolio.metamask.io/bridge?metametricsId=null',
'https://portfolio.metamask.io/bridge?metametricsId=null&metricsEnabled=false&marketingEnabled=false',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added metricsEnabled and marketingEnabled query parameters to the URL verification.

);
},
);
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/tests/portfolio/portfolio-site.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ describe('Portfolio site', function () {
await driver.switchToWindowWithTitle('E2E Test Page', windowHandles);

// Verify site
assert.equal(
await driver.getCurrentUrl(),
'https://portfolio.metamask.io/?metamaskEntry=ext_portfolio_button&metametricsId=null',
);
const currentUrl = await driver.getCurrentUrl();
const expectedUrl =
'https://portfolio.metamask.io/?metamaskEntry=ext_portfolio_button&metametricsId=null&metricsEnabled=false&marketingEnabled=false';
assert.equal(currentUrl, expectedUrl);
Comment on lines +45 to +48
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Updated the expected URL to include metricsEnabled and marketingEnabled query parameters.

},
);
});
Expand Down
14 changes: 8 additions & 6 deletions ui/components/app/wallet-overview/btc-overview.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import configureMockStore from 'redux-mock-store';
import { fireEvent } from '@testing-library/react';
import { fireEvent, waitFor } from '@testing-library/react';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added waitFor to handle asynchronous operations in tests.

import thunk from 'redux-thunk';
import { Cryptocurrency } from '@metamask/assets-controllers';
import { BtcAccountType, BtcMethod } from '@metamask/keyring-api';
Expand Down Expand Up @@ -208,6 +208,7 @@ describe('BtcOverview', () => {
metamaskEntry: RampsMetaMaskEntry.BuySellButton,
chainId: MultichainNetworks.BITCOIN,
metametricsId: mockMetaMetricsId,
metricsEnabled: String(false),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added metricsEnabled parameter to the URL to reflect user privacy preferences.

}),
});
});
Expand All @@ -227,11 +228,12 @@ describe('BtcOverview', () => {
fireEvent.click(portfolioButton as HTMLElement);

expect(openTabSpy).toHaveBeenCalledTimes(1);
expect(openTabSpy).toHaveBeenCalledWith({
url: makePortfolioUrl('', {
metamaskEntry: 'ext_portfolio_button',
metametricsId: mockMetaMetricsId,
await waitFor(() =>
expect(openTabSpy).toHaveBeenCalledWith({
url: expect.stringContaining(
`?metamaskEntry=ext_portfolio_button&metametricsId=${mockMetaMetricsId}`,
),
}),
Comment on lines +231 to 236
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Updated test to use waitFor to ensure the URL contains the correct query parameters.

});
);
});
});
14 changes: 13 additions & 1 deletion ui/components/app/wallet-overview/coin-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ import {
///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask)
SwapsEthToken,
getCurrentKeyring,
getDataCollectionForMarketing,
getMetaMetricsId,
getParticipateInMetaMetrics,
Comment on lines +39 to +41
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added selectors to fetch privacy preferences for marketing and MetaMetrics.

///: END:ONLY_INCLUDE_IF
getUseExternalServices,
} from '../../../selectors';
Expand Down Expand Up @@ -97,6 +99,8 @@ const CoinButtons = ({
///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask)
const location = useLocation();
const metaMetricsId = useSelector(getMetaMetricsId);
const isMetaMetricsEnabled = useSelector(getParticipateInMetaMetrics);
const isMarketingEnabled = useSelector(getDataCollectionForMarketing);
Comment on lines +102 to +103
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Fetched MetaMetrics and marketing preferences using Redux selectors.

const keyring = useSelector(getCurrentKeyring);
const usingHardwareWallet = isHardwareKeyring(keyring?.type);
///: END:ONLY_INCLUDE_IF
Expand Down Expand Up @@ -287,6 +291,8 @@ const CoinButtons = ({
'bridge',
'ext_bridge_button',
metaMetricsId,
isMetaMetricsEnabled,
isMarketingEnabled,
);
global.platform.openTab({
url: `${portfolioUrl}${
Expand All @@ -307,7 +313,13 @@ const CoinButtons = ({
}, [isBridgeChain, chainId, metaMetricsId]);

const handlePortfolioOnClick = useCallback(() => {
const url = getPortfolioUrl('', 'ext_portfolio_button', metaMetricsId);
const url = getPortfolioUrl(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Included privacy preferences in the portfolio URL.

'',
'ext_portfolio_button',
metaMetricsId,
isMetaMetricsEnabled,
isMarketingEnabled,
);
global.platform.openTab({ url });
trackEvent({
category: MetaMetricsEventCategory.Navigation,
Expand Down
14 changes: 12 additions & 2 deletions ui/components/multichain/token-list-item/token-list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import {
getMetaMetricsId,
getTestNetworkBackgroundColor,
getTokensMarketData,
getParticipateInMetaMetrics,
getDataCollectionForMarketing,
Comment on lines 39 to +43
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added selectors to fetch user privacy preferences for MetaMetrics and marketing data collection.

} from '../../../selectors';
import {
getMultichainCurrentChainId,
Expand Down Expand Up @@ -82,8 +84,10 @@ export const TokenListItem = ({
const isEvm = useSelector(getMultichainIsEvm);
const primaryTokenImage = useSelector(getMultichainNativeCurrencyImage);
const trackEvent = useContext(MetaMetricsContext);
const metaMetricsId = useSelector(getMetaMetricsId);
const chainId = useSelector(getMultichainCurrentChainId);
const metaMetricsId = useSelector(getMetaMetricsId);
const isMetaMetricsEnabled = useSelector(getParticipateInMetaMetrics);
const isMarketingEnabled = useSelector(getDataCollectionForMarketing);
Comment on lines 84 to +90
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Fetched user privacy preferences using Redux selectors.


// Scam warning
const showScamWarning =
Expand Down Expand Up @@ -133,7 +137,13 @@ export const TokenListItem = ({
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
const url = getPortfolioUrl('stake', 'ext_stake_button', metaMetricsId);
const url = getPortfolioUrl(
'stake',
'ext_stake_button',
metaMetricsId,
isMetaMetricsEnabled,
isMarketingEnabled,
Comment on lines 137 to +145
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Updated the URL generation logic to include metricsEnabled and marketingEnabled query parameters.

Comment on lines +143 to +145
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic: Potential security issue: Ensure that the values of isMetaMetricsEnabled and isMarketingEnabled are properly sanitized before being included in the URL.

);
global.platform.openTab({ url });
trackEvent({
event: MetaMetricsEventName.StakingEntryPointClicked,
Expand Down
6 changes: 6 additions & 0 deletions ui/components/ui/new-network-info/new-network-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
getMetaMetricsId,
getUseTokenDetection,
getUseExternalServices,
getParticipateInMetaMetrics,
getDataCollectionForMarketing,
Comment on lines 21 to +25
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added selectors to fetch user privacy preferences for MetaMetrics and marketing data collection.

} from '../../../selectors';
import { setFirstTimeUsedNetwork } from '../../../store/actions';
import {
Expand Down Expand Up @@ -49,6 +51,8 @@ export default function NewNetworkInfo() {
const currentNetwork = useSelector(getCurrentNetwork);
const metaMetricsId = useSelector(getMetaMetricsId);
const isBridgeChain = useSelector(getIsBridgeChain);
const isMetaMetricsEnabled = useSelector(getParticipateInMetaMetrics);
const isMarketingEnabled = useSelector(getDataCollectionForMarketing);
Comment on lines 51 to +55
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Fetched user privacy preferences for MetaMetrics and marketing data collection from the Redux store.


const onCloseClick = () => {
setShowPopup(false);
Expand Down Expand Up @@ -203,6 +207,8 @@ export default function NewNetworkInfo() {
'bridge',
'ext_bridge_new_network_info_link',
metaMetricsId,
isMetaMetricsEnabled,
isMarketingEnabled,
Comment on lines 207 to +211
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Appended isMetaMetricsEnabled and isMarketingEnabled to the URL for portfolio navigation.

)}&destChain=${currentNetwork?.chainId}`}
target="_blank"
rel="noreferrer"
Expand Down
15 changes: 13 additions & 2 deletions ui/helpers/utils/portfolio.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ export function getPortfolioUrl(
endpoint = '',
metamaskEntry = '',
metaMetricsId = '',
metricsEnabled = false,
marketingEnabled = false,
Comment on lines +5 to +6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added metricsEnabled and marketingEnabled parameters to reflect user privacy preferences.

) {
const portfolioUrl = process.env.PORTFOLIO_URL || '';
return `${portfolioUrl}/${endpoint}?metamaskEntry=${metamaskEntry}&metametricsId=${metaMetricsId}`;
const baseUrl = process.env.PORTFOLIO_URL || '';
const url = new URL(endpoint, baseUrl);

url.searchParams.append('metamaskEntry', metamaskEntry);
url.searchParams.append('metametricsId', metaMetricsId);

// Append privacy preferences for metrics + marketing on user navigation to Portfolio
url.searchParams.append('metricsEnabled', String(metricsEnabled));
url.searchParams.append('marketingEnabled', String(marketingEnabled));

return url.href;
Comment on lines +8 to +18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Updated URL construction to include new privacy parameters.

}
6 changes: 3 additions & 3 deletions ui/hooks/ramps/useRamps/useRamps.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('useRamps', () => {
},
};

const mockBuyURI = `${process.env.PORTFOLIO_URL}/buy?metamaskEntry=${metaMaskEntry}&chainId=${mockChainId}&metametricsId=${mockedMetametricsId}`;
const mockBuyURI = `${process.env.PORTFOLIO_URL}/buy?metamaskEntry=${metaMaskEntry}&chainId=${mockChainId}&metametricsId=${mockedMetametricsId}&metricsEnabled=false`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added metricsEnabled=false to the mockBuyURI to reflect the new privacy parameter.

const openTabSpy = jest.spyOn(global.platform, 'openTab');

const { result } = renderHook(() => useRamps(), { wrapper }); // default metamask entry
Expand All @@ -68,7 +68,7 @@ describe('useRamps', () => {
},
};

const mockBuyURI = `${process.env.PORTFOLIO_URL}/buy?metamaskEntry=${metaMaskEntry}&chainId=${mockChainId}&metametricsId=${mockedMetametricsId}`;
const mockBuyURI = `${process.env.PORTFOLIO_URL}/buy?metamaskEntry=${metaMaskEntry}&chainId=${mockChainId}&metametricsId=${mockedMetametricsId}&metricsEnabled=false`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Included metricsEnabled=false in the mockBuyURI for accurate testing of the new parameter.

const openTabSpy = jest.spyOn(global.platform, 'openTab');

const { result } = renderHook(
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('useRamps', () => {
},
};

const mockBuyURI = `${process.env.PORTFOLIO_URL}/buy?metamaskEntry=ext_buy_sell_button&chainId=${mockChainId}&metametricsId=${mockedMetametricsId}`;
const mockBuyURI = `${process.env.PORTFOLIO_URL}/buy?metamaskEntry=ext_buy_sell_button&chainId=${mockChainId}&metametricsId=${mockedMetametricsId}&metricsEnabled=false`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Updated mockBuyURI to include metricsEnabled=false for testing the privacy parameter.

const openTabSpy = jest.spyOn(global.platform, 'openTab');
const { result } = renderHook(() => useRamps(), { wrapper });

Expand Down
14 changes: 13 additions & 1 deletion ui/hooks/ramps/useRamps/useRamps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import { useCallback } from 'react';
import { useSelector } from 'react-redux';
import { CaipChainId } from '@metamask/utils';
import { ChainId } from '../../../../shared/constants/network';
import { getCurrentChainId, getMetaMetricsId } from '../../../selectors';
import {
getCurrentChainId,
getDataCollectionForMarketing,
getMetaMetricsId,
getParticipateInMetaMetrics,
Comment on lines +7 to +9
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added selectors to fetch marketing and MetaMetrics participation preferences.

} from '../../../selectors';

type IUseRamps = {
openBuyCryptoInPdapp: (chainId?: ChainId | CaipChainId) => void;
Expand All @@ -23,6 +28,8 @@ const useRamps = (
): IUseRamps => {
const chainId = useSelector(getCurrentChainId);
const metaMetricsId = useSelector(getMetaMetricsId);
const isMetaMetricsEnabled = useSelector(getParticipateInMetaMetrics);
const isMarketingEnabled = useSelector(getDataCollectionForMarketing);
Comment on lines +31 to +32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Fetched MetaMetrics participation preference from the Redux store.


Comment on lines +32 to 33
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Fetched marketing data collection preference from the Redux store.

const getBuyURI = useCallback(
(_chainId: ChainId | CaipChainId) => {
Expand All @@ -32,6 +39,11 @@ const useRamps = (
if (metaMetricsId) {
params.set('metametricsId', metaMetricsId);
}
params.set('metricsEnabled', String(isMetaMetricsEnabled));
if (isMarketingEnabled) {
params.set('marketingEnabled', String(isMarketingEnabled));
}
Comment on lines +42 to +45
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added metricsEnabled and marketingEnabled query parameters to the URL.


return `${portfolioUrl}/buy?${params.toString()}`;
},
[metaMetricsId],
Expand Down
4 changes: 1 addition & 3 deletions ui/pages/asset/components/asset-page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ describe('AssetPage', () => {

await waitFor(() =>
expect(openTabSpy).toHaveBeenCalledWith({
url: expect.stringContaining(
`/bridge?metamaskEntry=ext_bridge_button&metametricsId=&token=${token.address}`,
),
url: `https://portfolio.test/bridge?metamaskEntry=ext_bridge_button&metametricsId=&metricsEnabled=false&marketingEnabled=false&token=${token.address}`,
}),
Comment on lines 246 to 250
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Updated the expected URL to include metricsEnabled and marketingEnabled query parameters.

);
});
Expand Down
6 changes: 6 additions & 0 deletions ui/pages/asset/components/token-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import {
getIsBridgeChain,
getCurrentKeyring,
getMetaMetricsId,
getParticipateInMetaMetrics,
getDataCollectionForMarketing,
Comment on lines +32 to +33
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added selector to get MetaMetrics participation status.

///: END:ONLY_INCLUDE_IF
Comment on lines +33 to 34
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added selector to get marketing data collection status.

} from '../../../selectors';
import { INVALID_ASSET_TYPE } from '../../../helpers/constants/error-keys';
Expand Down Expand Up @@ -73,6 +75,8 @@ const TokenButtons = ({
const isBridgeChain = useSelector(getIsBridgeChain);
const isBuyableChain = useSelector(getIsNativeTokenBuyable);
const metaMetricsId = useSelector(getMetaMetricsId);
const isMetaMetricsEnabled = useSelector(getParticipateInMetaMetrics);
const isMarketingEnabled = useSelector(getDataCollectionForMarketing);
Comment on lines +78 to +79
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Retrieved MetaMetrics participation status from Redux store.

const { openBuyCryptoInPdapp } = useRamps();
Comment on lines +79 to 80
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Retrieved marketing data collection status from Redux store.

///: END:ONLY_INCLUDE_IF

Expand Down Expand Up @@ -284,6 +288,8 @@ const TokenButtons = ({
'bridge',
'ext_bridge_button',
metaMetricsId,
isMetaMetricsEnabled,
isMarketingEnabled,
);
Comment on lines +291 to 293
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Included new query parameters for privacy settings in the Portfolio URL.

global.platform.openTab({
url: `${portfolioUrl}&token=${token.address}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jest.mock('../../../contexts/transaction-modal', () => ({
}));

const EXPECTED_BUY_URL =
'https://portfolio.test/buy?metamaskEntry=ext_buy_sell_button&chainId=0x5';
'https://portfolio.test/buy?metamaskEntry=ext_buy_sell_button&chainId=0x5&metricsEnabled=false';
Comment on lines 12 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Updated EXPECTED_BUY_URL to include metricsEnabled query parameter.


function processAlertActionKey(actionKey: string) {
const { result } = renderHookWithProvider(
Expand Down
6 changes: 6 additions & 0 deletions ui/pages/swaps/prepare-swap-page/prepare-swap-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ import {
getHardwareWalletType,
getIsBridgeChain,
getMetaMetricsId,
getParticipateInMetaMetrics,
getDataCollectionForMarketing,
} from '../../../selectors';
Comment on lines 64 to 69
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Added selectors to fetch user privacy preferences for MetaMetrics and marketing data collection.

import {
getSmartTransactionsOptInStatus,
Expand Down Expand Up @@ -219,6 +221,8 @@ export default function PrepareSwapPage({
const currentCurrency = useSelector(getCurrentCurrency);
const fetchingQuotes = useSelector(getFetchingQuotes);
const loadingComplete = !fetchingQuotes && areQuotesPresent;
const isMetaMetricsEnabled = useSelector(getParticipateInMetaMetrics);
const isMarketingEnabled = useSelector(getDataCollectionForMarketing);
Comment on lines 221 to +225
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Fetched user privacy preferences using the newly added selectors.


const fetchParamsFromToken = isSwapsDefaultTokenSymbol(
sourceTokenInfo?.symbol,
Expand Down Expand Up @@ -1024,6 +1028,8 @@ export default function PrepareSwapPage({
'bridge',
'ext_bridge_prepare_swap_link',
metaMetricsId,
isMetaMetricsEnabled,
isMarketingEnabled,
);
Comment on lines 1028 to 1033
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info: Passed the fetched privacy preferences to the getPortfolioUrl function.


global.platform.openTab({
Expand Down