Skip to main content

Function: useAttachmentUrl()

function useAttachmentUrl(attachmentId, blob): string | undefined;

Defined in: components/capture.tsx:375

A displayable URL for one attachment.

Prefers the in-memory blob (the capture that just happened), then asks the storage adapter for a URI (a draft reopened later). Object URLs are revoked on unmount and whenever the blob changes — docs/14 §12 calls a leaked object URL out by name, because on a 1 GB device a few un-revoked photos are the difference between a working form and a killed tab.

Parameters

ParameterType
attachmentIdstring | undefined
blobBlob | undefined

Returns

string | undefined