Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions packages/components/OptimizedImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ export const OptimizedImage: React.FC<
crossOrigin="anonymous"
width={sourceWidth}
height={sourceHeight}
onError={() => {
if (shouldUseFallback) {
setIsFallbackError(true);
return;
}
setIsError(true);
}}
style={{
objectFit: "contain",
borderWidth: 0,
Expand Down Expand Up @@ -121,10 +114,8 @@ const transformURI = (
}

if (uri?.startsWith("ipfs://")) {
// FIXME: passing the gateway token here is unsafe and people could rip our cap but the host origin method seems broken atm
const gatewayAccessToken =
"0Ik-SBA6O3xxcvHBRmD526aG06EEwIqwcr14MFfFveyotZmOI4v9gLfJgHW3SRFY";
return `https://teritori.mypinata.cloud/ipfs/${uri.substring("ipfs://".length)}?img-width=${Math.round(width)}&img-height=${Math.round(height)}&img-fit=contain&pinataGatewayToken=${gatewayAccessToken}`;
// XXX: allow passing a dev token
return `https://teritori.mypinata.cloud/ipfs/${uri.substring("ipfs://".length)}?img-width=${Math.round(width)}&img-height=${Math.round(height)}&img-fit=contain`;
}

const params = resolveParams(width, height);
Expand Down
Loading