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

2
.husky/.gitignore vendored
View File

@ -1 +1 @@
_
_

View File

@ -10,8 +10,6 @@ import { ReceiptData_datatokens_updates as ReceiptData } from '../../../@types/a
const getReceipts = gql`
query ReceiptData($address: ID!) {
datatokens(where: { id: $address }) {
createTime
tx
updates(orderBy: timestamp, orderDirection: desc) {
id
tx
@ -33,8 +31,15 @@ export default function EditHistory(): ReactElement {
useEffect(() => {
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])
return (