You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make IPFS gateway fetching a user-selectable option
Review feedback on the gateway feature: the gateway URL is technically
not the URI recorded on chain, so translating ipfs:// URIs to
https://ipfs.io/ipfs/... should be something the user opts into rather
than automatic behavior.
- New 'Fetch IPFS content through a gateway' switch in Settings > NFT,
off by default. While off, ipfs:// URIs behave as before the gateway
feature: they fail URL validation and are never fetched, and the
NFTHashStatus badge flags them again.
- The preference is stored as nftIpfsGateway via the existing
prefs.yaml round-trip; the main process reads the persisted value
through electron/utils/ipfsGateway.ts (fail-closed when the store is
unreadable) at every site that translated URLs: isValidURL,
downloadFile, fetchBuffer, fetchJSON, the single-NFT download
handler, and the dapp dialog's oversized-image fallback. The ipfs
scheme check runs before the preference read so non-ipfs requests
never touch the store.
- The oversized-image fallback returns no preview (instead of a
CSP-blocked raw ipfs URI) while the option is off.
- Nothing is persisted for a rejected ipfs URL (the outer isValidURL
guard throws before the cache-info error sidecar is written), so
enabling the option retries previously failing NFTs cleanly.
- util/ipfs.ts stays a pure translation helper shared with the
renderer; the preference gate lives only in the electron layer and
the useIpfsGateway hook.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LdfCqRSBWwMpCDh1SdE24e
0 commit comments