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:
parent
aa6cceaf0e
commit
c9a8345222
@ -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 (
|
||||||
|
Loading…
Reference in New Issue
Block a user