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

Removing showing updates on never updated assets (#438)

* removes showing updates on never updated assets

* package-lock fix
This commit is contained in:
Dimo Dzhurenov 2021-03-16 20:23:11 +02:00 committed by GitHub
parent aa6cceaf0e
commit c9a8345222
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -10,8 +10,6 @@ import { ReceiptData_datatokens_updates as ReceiptData } from '../../../@types/a
const getReceipts = gql` const getReceipts = gql`
query ReceiptData($address: ID!) { query ReceiptData($address: ID!) {
datatokens(where: { id: $address }) { datatokens(where: { id: $address }) {
createTime
tx
updates(orderBy: timestamp, orderDirection: desc) { updates(orderBy: timestamp, orderDirection: desc) {
id id
tx tx
@ -33,8 +31,15 @@ export default function EditHistory(): ReactElement {
useEffect(() => { useEffect(() => {
if (!data || data.datatokens.length === 0) return if (!data || data.datatokens.length === 0) return
setReceipts(data.datatokens[0].updates)
setCreationTx(data.datatokens[0].tx) const receiptCollectionLength = data.datatokens[0].updates.length
const creationData = data.datatokens[0].updates[receiptCollectionLength - 1]
setCreationTx(creationData.tx)
const receiptCollection = [...data.datatokens[0].updates]
receiptCollection.splice(-1, 1)
setReceipts(receiptCollection)
}, [data]) }, [data])
return ( return (