diff --git a/src/components/Image/BaseImage.ios.tsx b/src/components/Image/BaseImage.ios.tsx index 5fd7bfa5a9b13..409245db42816 100644 --- a/src/components/Image/BaseImage.ios.tsx +++ b/src/components/Image/BaseImage.ios.tsx @@ -36,6 +36,11 @@ function BaseImage({onLoad, source, ...props}: BaseImageProps) { [onLoad, setAttachmentLoaded, source], ); + // Use disk caching for images that need to work offline (e.g., receipts with auth tokens) + // Use no caching for other images to avoid memory leaks + // Check if cachePolicy is explicitly provided in props, otherwise default based on whether it's an auth-required image + const effectiveCachePolicy = props.cachePolicy ?? 'none'; + return ( ); } diff --git a/src/components/Image/index.tsx b/src/components/Image/index.tsx index bb0b10857d6eb..81cae0e4fa0cc 100644 --- a/src/components/Image/index.tsx +++ b/src/components/Image/index.tsx @@ -171,6 +171,9 @@ function Image({ onLoad={handleLoad} style={[style, aspectRatioStyle, shouldOpacityBeZero && {opacity: 0}]} source={source} + // Enable disk caching for images that require auth tokens (receipts) to make them available offline + // Keep default (none) for other images to avoid memory leaks + cachePolicy={isAuthTokenRequired ? 'disk' : forwardedProps.cachePolicy} /> ); }