diff --git a/client/src/hooks/use-ipfs-api.tsx b/client/src/hooks/use-ipfs-api.tsx index f92c998..4f08752 100644 --- a/client/src/hooks/use-ipfs-api.tsx +++ b/client/src/hooks/use-ipfs-api.tsx @@ -8,9 +8,9 @@ let ipfsMessage = '' let ipfsVersion = '' export interface IpfsConfig { + protocol: string host: string port: string - protocol: string } export default function useIpfsApi(config: IpfsConfig) { diff --git a/client/src/routes/Publish/Files/Ipfs/index.tsx b/client/src/routes/Publish/Files/Ipfs/index.tsx index 0a2455d..62ca322 100644 --- a/client/src/routes/Publish/Files/Ipfs/index.tsx +++ b/client/src/routes/Publish/Files/Ipfs/index.tsx @@ -10,11 +10,13 @@ import Form from './Form' const { hostname, port, protocol } = new URL(ipfsNodeUri) const ipfsConfig: IpfsConfig = { + protocol: protocol.replace(':', ''), host: hostname, - port, - protocol: protocol.replace(':', '') + port: port || '443' } +console.log(ipfsConfig) + export default function Ipfs({ addFile }: { addFile(url: string): void }) { const { ipfs, isIpfsReady, ipfsError, ipfsMessage } = useIpfsApi(ipfsConfig) const [loading, setLoading] = useState(false)