feat: update transaction details on cancel
This commit is contained in:
parent
ff474ee507
commit
9bb2f951b3
2 changed files with 12 additions and 20 deletions
|
|
@ -341,5 +341,5 @@ const DetailsRow = ({ it: tx, timezone }) => {
|
|||
export default memo(
|
||||
DetailsRow,
|
||||
(prev, next) =>
|
||||
prev.it.id === next.it.id && prev.it.hasError === next.it.hasError
|
||||
prev.it.id === next.it.id && getStatus(prev.it) === getStatus(next.it)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import BigNumber from 'bignumber.js'
|
|||
import gql from 'graphql-tag'
|
||||
import { utils as coinUtils } from 'lamassu-coins'
|
||||
import * as R from 'ramda'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import React, { useState } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import LogsDowloaderPopover from 'src/components/LogsDownloaderPopper'
|
||||
|
|
@ -122,23 +122,15 @@ const Transactions = () => {
|
|||
const { data: filtersResponse, loading: loadingFilters } = useQuery(
|
||||
GET_TRANSACTION_FILTERS
|
||||
)
|
||||
const [filteredTransactions, setFilteredTransactions] = useState([])
|
||||
const [variables, setVariables] = useState({ limit: NUM_LOG_RESULTS })
|
||||
const {
|
||||
data: txResponse,
|
||||
loading: loadingTransactions,
|
||||
refetch,
|
||||
startPolling,
|
||||
stopPolling
|
||||
} = useQuery(GET_TRANSACTIONS, {
|
||||
variables,
|
||||
onCompleted: data => setFilteredTransactions(R.path(['transactions'])(data))
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
startPolling(10000)
|
||||
return stopPolling
|
||||
})
|
||||
const { data: txData, loading: loadingTransactions, refetch } = useQuery(
|
||||
GET_TRANSACTIONS,
|
||||
{
|
||||
variables,
|
||||
pollInterval: 10000
|
||||
}
|
||||
)
|
||||
const txList = txData ? txData.transactions : []
|
||||
|
||||
const { data: configResponse, configLoading } = useQuery(GET_DATA)
|
||||
const timezone = R.path(['config', 'locale_timezone'], configResponse)
|
||||
|
|
@ -273,7 +265,7 @@ const Transactions = () => {
|
|||
onChange={onFilterChange}
|
||||
/>
|
||||
</div>
|
||||
{txResponse && (
|
||||
{txList && (
|
||||
<div className={classes.buttonsWrapper}>
|
||||
<LogsDowloaderPopover
|
||||
title="Download logs"
|
||||
|
|
@ -307,7 +299,7 @@ const Transactions = () => {
|
|||
loading={loadingTransactions && configLoading}
|
||||
emptyText="No transactions so far"
|
||||
elements={elements}
|
||||
data={filteredTransactions}
|
||||
data={txList}
|
||||
Details={DetailsRow}
|
||||
expandable
|
||||
rowSize="sm"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue