Skip to content

Commit 68a9931

Browse files
Fix MediaGridItem for undownloaded GIFs
Co-authored-by: Fedor Indutny <[email protected]>
1 parent b5b7b7b commit 68a9931

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ts/components/conversation/media-gallery/MediaGridItem.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function MediaGridItem(props: Props): JSX.Element {
5151
);
5252

5353
let label: string;
54-
if (attachment.url || attachment.incrementalUrl) {
54+
if (url != null) {
5555
label = i18n('icu:imageOpenAlt');
5656
} else if (attachment.pending) {
5757
label = i18n('icu:cancelDownload');
@@ -84,7 +84,8 @@ type SpinnerOverlayProps = Readonly<{
8484
function SpinnerOverlay(props: SpinnerOverlayProps): JSX.Element | undefined {
8585
const { attachment } = props;
8686

87-
if (attachment.url != null || attachment.incrementalUrl != null) {
87+
const url = getUrl(attachment);
88+
if (url != null) {
8889
return undefined;
8990
}
9091

@@ -131,8 +132,8 @@ type MetadataOverlayProps = Readonly<{
131132
function MetadataOverlay(props: MetadataOverlayProps): JSX.Element | undefined {
132133
const { i18n, attachment } = props;
133134

134-
const canBeShown =
135-
attachment.url != null || attachment.incrementalUrl != null;
135+
const url = getUrl(attachment);
136+
const canBeShown = url != null;
136137
if (canBeShown && !isGIF([attachment])) {
137138
return undefined;
138139
}

0 commit comments

Comments
 (0)