fix: only log swap success for swap txs (#7284)

This commit is contained in:
eddie 2023-09-08 12:03:59 -07:00 committed by GitHub
parent bb28235bee
commit 84f5d8f94d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,7 +12,7 @@ import { L2_CHAIN_IDS } from '../../constants/chains'
import { useAddPopup } from '../application/hooks'
import { isPendingTx } from './hooks'
import { checkedTransaction, finalizeTransaction } from './reducer'
import { SerializableTransactionReceipt, TransactionDetails } from './types'
import { SerializableTransactionReceipt, TransactionDetails, TransactionType } from './types'
export function toSerializableReceipt(receipt: TransactionReceipt): SerializableTransactionReceipt {
return {
@ -58,7 +58,9 @@ export default function Updater() {
})
)
logSwapSuccess(hash, chainId, analyticsContext)
if (pendingTransactions[hash] && pendingTransactions[hash].info?.type === TransactionType.SWAP) {
logSwapSuccess(hash, chainId, analyticsContext)
}
addPopup(
{
@ -69,7 +71,7 @@ export default function Updater() {
isL2 ? L2_TXN_DISMISS_MS : DEFAULT_TXN_DISMISS_MS
)
},
[addPopup, analyticsContext, dispatch, isL2]
[addPopup, analyticsContext, dispatch, isL2, pendingTransactions]
)
return <LibUpdater pendingTransactions={pendingTransactions} onCheck={onCheck} onReceipt={onReceipt} />