Skip to content

Commit

Permalink
Getting transactionId from DDO
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiehewitt15 committed Aug 10, 2021
1 parent ae4deb7 commit 434091d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/components/organisms/AssetContent/EditHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@ export default function EditHistory(): ReactElement {
const { data } = result

const [receipts, setReceipts] = useState<ReceiptData[]>()
const [creationTx, setCreationTx] = useState<string>()

useEffect(() => {
if (!data || data.datatokens.length === 0) return

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)

Expand All @@ -55,7 +50,7 @@ export default function EditHistory(): ReactElement {
</li>
))}
<li className={styles.item}>
<ExplorerLink networkId={ddo.chainId} path={`/tx/${creationTx}`}>
<ExplorerLink networkId={ddo.chainId} path={`/tx/${ddo.event.txid}`}>
published <Time date={ddo.created} relative />
</ExplorerLink>
</li>
Expand Down

0 comments on commit 434091d

Please sign in to comment.