Skip to content

Commit bf1d1f3

Browse files
committed
chore: add walletType to transaction event
1 parent ec68991 commit bf1d1f3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/TransactionEventHandler.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { useEffect, useRef } from 'react';
22
import { useRootStore } from 'src/store/root';
33
import { GENERAL } from 'src/utils/events';
44
import { getNetworkConfig } from 'src/utils/marketsAndNetworksConfig';
5+
import { useShallow } from 'zustand/react/shallow';
56

67
export const TransactionEventHandler = () => {
78
const postedTransactionsRef = useRef<{ [chainId: string]: string[] }>({});
89

9-
const trackEvent = useRootStore((store) => store.trackEvent);
10-
const transactions = useRootStore((store) => store.transactions);
10+
const [trackEvent, transactions, walletType] = useRootStore(
11+
useShallow((store) => [store.trackEvent, store.transactions, store.walletType])
12+
);
1113

1214
//tx's currently tracked: supply, borrow, withdraw, repay, repay with coll, collateral switch
1315

@@ -42,6 +44,7 @@ export const TransactionEventHandler = () => {
4244
outAmountUsd: tx.outAmountUsd,
4345
chainId: chainIdNumber,
4446
chainName: networkConfig.displayName || networkConfig.name,
47+
walletType,
4548
});
4649

4750
// update ref

0 commit comments

Comments
 (0)