mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix user's pool transactions history (#786)
This commit is contained in:
parent
34f7728399
commit
f74c40b9cf
@ -129,9 +129,11 @@ const columnsMinimal = [columns[0], columns[3]]
|
||||
|
||||
export default function PoolTransactions({
|
||||
poolAddress,
|
||||
poolChainId,
|
||||
minimal
|
||||
}: {
|
||||
poolAddress?: string
|
||||
poolChainId?: number[]
|
||||
minimal?: boolean
|
||||
}): ReactElement {
|
||||
const { accountId } = useWeb3()
|
||||
@ -143,13 +145,17 @@ export default function PoolTransactions({
|
||||
const [data, setData] = useState<PoolTransaction[]>()
|
||||
|
||||
async function fetchPoolTransactionData() {
|
||||
const variables = { user: accountId?.toLowerCase() }
|
||||
const variables = {
|
||||
user: accountId?.toLowerCase(),
|
||||
pool: poolAddress?.toLowerCase()
|
||||
}
|
||||
const transactions: PoolTransaction[] = []
|
||||
const result = await fetchDataForMultipleChains(
|
||||
poolAddress ? txHistoryQueryByPool : txHistoryQuery,
|
||||
variables,
|
||||
chainIds
|
||||
poolAddress ? poolChainId : chainIds
|
||||
)
|
||||
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
result[i].poolTransactions.forEach((poolTransaction: PoolTransaction) => {
|
||||
transactions.push(poolTransaction)
|
||||
|
@ -386,7 +386,11 @@ export default function Pool(): ReactElement {
|
||||
|
||||
{accountId && (
|
||||
<AssetActionHistoryTable title="Your Pool Transactions">
|
||||
<PoolTransactions poolAddress={price?.address} minimal />
|
||||
<PoolTransactions
|
||||
poolAddress={price?.address}
|
||||
poolChainId={[ddo.chainId]}
|
||||
minimal
|
||||
/>
|
||||
</AssetActionHistoryTable>
|
||||
)}
|
||||
</>
|
||||
|
Loading…
Reference in New Issue
Block a user