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(
|
export default memo(
|
||||||
DetailsRow,
|
DetailsRow,
|
||||||
(prev, next) =>
|
(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 gql from 'graphql-tag'
|
||||||
import { utils as coinUtils } from 'lamassu-coins'
|
import { utils as coinUtils } from 'lamassu-coins'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { useHistory } from 'react-router-dom'
|
import { useHistory } from 'react-router-dom'
|
||||||
|
|
||||||
import LogsDowloaderPopover from 'src/components/LogsDownloaderPopper'
|
import LogsDowloaderPopover from 'src/components/LogsDownloaderPopper'
|
||||||
|
|
@ -122,23 +122,15 @@ const Transactions = () => {
|
||||||
const { data: filtersResponse, loading: loadingFilters } = useQuery(
|
const { data: filtersResponse, loading: loadingFilters } = useQuery(
|
||||||
GET_TRANSACTION_FILTERS
|
GET_TRANSACTION_FILTERS
|
||||||
)
|
)
|
||||||
const [filteredTransactions, setFilteredTransactions] = useState([])
|
|
||||||
const [variables, setVariables] = useState({ limit: NUM_LOG_RESULTS })
|
const [variables, setVariables] = useState({ limit: NUM_LOG_RESULTS })
|
||||||
const {
|
const { data: txData, loading: loadingTransactions, refetch } = useQuery(
|
||||||
data: txResponse,
|
GET_TRANSACTIONS,
|
||||||
loading: loadingTransactions,
|
{
|
||||||
refetch,
|
variables,
|
||||||
startPolling,
|
pollInterval: 10000
|
||||||
stopPolling
|
}
|
||||||
} = useQuery(GET_TRANSACTIONS, {
|
)
|
||||||
variables,
|
const txList = txData ? txData.transactions : []
|
||||||
onCompleted: data => setFilteredTransactions(R.path(['transactions'])(data))
|
|
||||||
})
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
startPolling(10000)
|
|
||||||
return stopPolling
|
|
||||||
})
|
|
||||||
|
|
||||||
const { data: configResponse, configLoading } = useQuery(GET_DATA)
|
const { data: configResponse, configLoading } = useQuery(GET_DATA)
|
||||||
const timezone = R.path(['config', 'locale_timezone'], configResponse)
|
const timezone = R.path(['config', 'locale_timezone'], configResponse)
|
||||||
|
|
@ -273,7 +265,7 @@ const Transactions = () => {
|
||||||
onChange={onFilterChange}
|
onChange={onFilterChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{txResponse && (
|
{txList && (
|
||||||
<div className={classes.buttonsWrapper}>
|
<div className={classes.buttonsWrapper}>
|
||||||
<LogsDowloaderPopover
|
<LogsDowloaderPopover
|
||||||
title="Download logs"
|
title="Download logs"
|
||||||
|
|
@ -307,7 +299,7 @@ const Transactions = () => {
|
||||||
loading={loadingTransactions && configLoading}
|
loading={loadingTransactions && configLoading}
|
||||||
emptyText="No transactions so far"
|
emptyText="No transactions so far"
|
||||||
elements={elements}
|
elements={elements}
|
||||||
data={filteredTransactions}
|
data={txList}
|
||||||
Details={DetailsRow}
|
Details={DetailsRow}
|
||||||
expandable
|
expandable
|
||||||
rowSize="sm"
|
rowSize="sm"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue