diff --git a/apps/dashboard/src/components/ipfs-upload/dropzone.tsx b/apps/dashboard/src/components/ipfs-upload/dropzone.tsx index f3a04b5b130..ff642dde7b8 100644 --- a/apps/dashboard/src/components/ipfs-upload/dropzone.tsx +++ b/apps/dashboard/src/components/ipfs-upload/dropzone.tsx @@ -192,8 +192,9 @@ const FileUpload: React.FC = ({ files, updateFiles }) => { return replaceIpfsUrl(ipfsHashes[0]); } // get the folder - // return replaceIpfsUrl(ipfsHashes[0].split("/").slice(0, -1).join("/")); - return `https://ipfs.io/ipfs/${ipfsHashes[0].split("ipfs://")[1]}`; + const uri = ipfsHashes[0].split("ipfs://")[1]; + const folderPath = uri.split("/")[0]; // "Qma.../image.png" -> "Qma..." + return `https://ipfs.io/ipfs/${folderPath}`; }, [ipfsHashes]); const filesToShow = useMemo(() => {