Skip to content

Commit

Permalink
fix: analytics tracking for connect widget (#1609)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharonsheah authored Mar 20, 2024
1 parent 8623a1d commit 4de1c9e
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,6 @@ export function WalletList(props: WalletListProps) {
const isMetaMask = providerDetail.info.rdns === WalletProviderRdns.METAMASK;
const web3Provider = new Web3Provider(providerDetail.provider as any);

track({
userJourney: UserJourney.CONNECT,
screen: 'ConnectWallet',
control: 'Wallet',
controlType: 'MenuItem',
extras: {
wallet: getProviderSlugFromRdns(providerDetail.info.rdns),
walletRdns: providerDetail.info.rdns,
walletUuid: providerDetail.info.uuid,
},
});

try {
// TODO: Find a nice way to detect if the wallet supports switching accounts via requestPermissions
const changeAccount = isMetaMask;
Expand Down Expand Up @@ -203,6 +191,12 @@ export function WalletList(props: WalletListProps) {
};

const handleWalletConnectConnection = async () => {
track({
userJourney: UserJourney.CONNECT,
screen: 'ConnectWallet',
control: 'WalletConnect',
controlType: 'MenuItem',
});
await openWalletConnectModal({
connectCallback,
restoreSession: true,
Expand Down Expand Up @@ -254,6 +248,12 @@ export function WalletList(props: WalletListProps) {
}, [chosenProviderDetail]);

const onBrowserWalletsClick = useCallback(() => {
track({
userJourney: UserJourney.CONNECT,
screen: 'ConnectWallet',
control: 'BrowserWallets',
controlType: 'MenuItem',
});
setShowWalletDrawer(true);
}, [track]);

Expand Down

0 comments on commit 4de1c9e

Please sign in to comment.