From 4920bae0fad54a5e899b1a5f286e144084f0778b Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 7 Oct 2019 13:06:24 +0200 Subject: [PATCH] api port tweaks --- client/src/hooks/use-ipfs-api.tsx | 2 +- client/src/routes/Publish/Files/Ipfs/index.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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)