diff --git a/package-lock.json b/package-lock.json index 51edec9..fa81b68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "redux-thunk": "^2.4.2", "stream": "^0.0.2", "tailwindcss": "^3.3.3", - "tlsn-js": "^0.1.0-alpha.4.3" + "tlsn-js": "^0.1.0-alpha.5.2" }, "devDependencies": { "@babel/core": "^7.20.12", @@ -19481,9 +19481,9 @@ "dev": true }, "node_modules/tlsn-js": { - "version": "0.1.0-alpha.4.3", - "resolved": "https://registry.npmjs.org/tlsn-js/-/tlsn-js-0.1.0-alpha.4.3.tgz", - "integrity": "sha512-3E9i9aQE42gW3a6zsmjfqomDgG1baqj6D1z5dp40Q8b6oETpSpAKDN021tfs9woLyI0xRWxO1tBcd7gnVtK7zw==", + "version": "0.1.0-alpha.5.2", + "resolved": "https://registry.npmjs.org/tlsn-js/-/tlsn-js-0.1.0-alpha.5.2.tgz", + "integrity": "sha512-5QEAzjOPLrw7TN5nRYphUbVBihZ2ufIQ+BcKnTw+0MejqZHo9pUcjHGkrkt9EfhdkC2zsWWKbDZXlAPxwaPtOQ==", "dependencies": { "comlink": "^4.4.1" }, @@ -34888,9 +34888,9 @@ "dev": true }, "tlsn-js": { - "version": "0.1.0-alpha.4.3", - "resolved": "https://registry.npmjs.org/tlsn-js/-/tlsn-js-0.1.0-alpha.4.3.tgz", - "integrity": "sha512-3E9i9aQE42gW3a6zsmjfqomDgG1baqj6D1z5dp40Q8b6oETpSpAKDN021tfs9woLyI0xRWxO1tBcd7gnVtK7zw==", + "version": "0.1.0-alpha.5.2", + "resolved": "https://registry.npmjs.org/tlsn-js/-/tlsn-js-0.1.0-alpha.5.2.tgz", + "integrity": "sha512-5QEAzjOPLrw7TN5nRYphUbVBihZ2ufIQ+BcKnTw+0MejqZHo9pUcjHGkrkt9EfhdkC2zsWWKbDZXlAPxwaPtOQ==", "requires": { "comlink": "^4.4.1" } diff --git a/server/index.tsx b/server/index.tsx index 72268d1..f59fbed 100644 --- a/server/index.tsx +++ b/server/index.tsx @@ -95,7 +95,6 @@ app.get('/ipfs/:cid', async (req, res) => { const imgUrl= 'data:image/png;base64,' + img.toString('base64'); - console.log(imgUrl); res.send(` diff --git a/web/components/FileUpload/index.tsx b/web/components/FileUpload/index.tsx index ae37ae7..13cf8fc 100644 --- a/web/components/FileUpload/index.tsx +++ b/web/components/FileUpload/index.tsx @@ -1,6 +1,6 @@ import React, { ReactElement, useCallback, useState } from 'react'; import { useDispatch } from 'react-redux'; -import { uploadFile } from '../../store/proofupload'; +import { uploadFile, selectProof } from '../../store/proofupload'; import { readFileAsync } from '../../utils'; import NotaryKey from '../NotaryKey'; import ProofDetails from '../ProofDetails'; diff --git a/web/components/ProofDetails/index.tsx b/web/components/ProofDetails/index.tsx index e95f11f..c93e389 100644 --- a/web/components/ProofDetails/index.tsx +++ b/web/components/ProofDetails/index.tsx @@ -63,8 +63,8 @@ const ProofDetails: React.FC = ({proof, cid, file}): ReactEle const proofToDisplay = selectedProof?.proof || proof; const inputValue = process.env.NODE_ENV === "development" - ? `http://localhost:3000/${selectedProof?.ipfsCID ? selectedProof?.ipfsCID : cid}` - : `www.tlsnexplorer.com/${selectedProof?.ipfsCID ? selectedProof?.ipfsCID : cid}`; + ? `http://localhost:3000/ipfs/${selectedProof?.ipfsCID ? selectedProof?.ipfsCID : cid}` + : `https://explorer-tlsn.pse.dev/ipfs/${selectedProof?.ipfsCID ? selectedProof?.ipfsCID : cid}`; // TODO - Format proof details for redacted data diff --git a/web/components/ProofSelect/index.tsx b/web/components/ProofSelect/index.tsx index 0cc06fe..b20de2a 100644 --- a/web/components/ProofSelect/index.tsx +++ b/web/components/ProofSelect/index.tsx @@ -1,18 +1,19 @@ -import React, { ReactElement } from 'react'; +import React, { ReactElement, useCallback } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { selectProof } from '../../store/proofupload'; +import { selectProof, useSelectedProof } from '../../store/proofupload'; export default function ProofSelect(): ReactElement { const dispatch = useDispatch(); - + const selectedProof = useSelectedProof(); const proofs = useSelector((state: any) => state.proofUpload.proofs); - const handleChange = async (e: React.ChangeEvent) => { + + const handleChange = useCallback(async (e: React.ChangeEvent) => { const selectedIndex = e.target.selectedIndex; const proof = proofs[selectedIndex - 1]; dispatch(selectProof(proof)); - } + }, []); return (
@@ -20,7 +21,7 @@ export default function ProofSelect(): ReactElement {