1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Fix refetch data token orders (#700)

* refetch token orders inside getJobs

* removed logs

* don't use Time component for Finished column if date is undefined

* removed logs

Co-authored-by: Norbi <katunanorbert@gmai.com>
This commit is contained in:
Norbi 2021-06-28 12:47:56 +03:00 committed by GitHub
parent 31ee1aab98
commit c81a986261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,7 +60,11 @@ const columns = [
{
name: 'Finished',
selector: function getTimeRow(row: ComputeJobMetaData) {
return <Time date={row.dateFinished} isUnix relative />
return row.dateFinished ? (
<Time date={row.dateFinished} isUnix relative />
) : (
''
)
}
},
{
@ -103,7 +107,7 @@ export default function ComputeJobs(): ReactElement {
const { accountId } = useWeb3()
const [isLoading, setIsLoading] = useState(true)
const [jobs, setJobs] = useState<ComputeJobMetaData[]>([])
const { data } = useQuery<ComputeOrders>(getComputeOrders, {
const { data, refetch } = useQuery<ComputeOrders>(getComputeOrders, {
variables: {
user: accountId?.toLowerCase()
}
@ -114,6 +118,7 @@ export default function ComputeJobs(): ReactElement {
setIsLoading(true)
await refetch()
const dtList = []
const computeJobs: ComputeJobMetaData[] = []
for (let i = 0; i < data.tokenOrders.length; i++) {