Skip to content
Open
Show file tree
Hide file tree
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
25 changes: 13 additions & 12 deletions packages/mobile/src/components/ui/Media/MediaGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,19 @@ export const MediaGallery = memo(
]}
onLayout={(e) => setWrapperWidth(e.nativeEvent.layout.width)}
>
<ImageBackground
source={{ uri: embeddedThumbUrl }}
style={{
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
opacity: wrapperWidth ? 0 : 1,
}}
blurRadius={2}
/>
{embeddedThumbUrl && !wrapperWidth && (
<ImageBackground
source={{ uri: embeddedThumbUrl }}
style={{
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
}}
blurRadius={2}
/>
)}
{payloads.slice(0, maxVisible).map((item, index) => {
const size = imageSize(index);
if (!size) return null;
Expand Down
4 changes: 2 additions & 2 deletions packages/mobile/src/components/ui/OdinImage/OdinImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const OdinImage = memo(
if (enableZoom) {
return (
<ZoomableImage
key={`${fileId || globalTransitId}_${fileKey}_${imageData ? '1' : '0'}`}
key={`${fileId || globalTransitId}_${fileKey}`}
uri={uri}
imageSize={imageSize}
alt={alt || title}
Expand All @@ -132,7 +132,7 @@ export const OdinImage = memo(

return (
<InnerImage
key={`${fileId || globalTransitId}_${fileKey}_${imageData ? '1' : '0'}`}
key={`${fileId || globalTransitId}_${fileKey}`}
uri={uri}
contentType={imageData?.type || previewThumbnail?.contentType}
style={style}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,8 @@ const useImage = (props?: {
lastModified,
systemFileType
),
// Stale time is 0, to always trigger a fetch,
// while the fetch checks if we have anything in cache from before and confirms it on disk
staleTime: 0,
refetchOnMount: true,
staleTime: 1000 * 60 * 5,
refetchOnMount: false,
refetchOnWindowFocus: false,
enabled: !!imageFileId && imageFileId !== '',
}),
Expand Down