diff --git a/ts/components/conversation/Image.tsx b/ts/components/conversation/Image.tsx
index f595dd1ded..077e0fef45 100644
--- a/ts/components/conversation/Image.tsx
+++ b/ts/components/conversation/Image.tsx
@@ -14,10 +14,12 @@ import type {
} from '../../types/Attachment';
import {
defaultBlurHash,
+ isDownloadable,
isIncremental,
isReadyToView,
} from '../../types/Attachment';
import { ProgressCircle } from '../ProgressCircle';
+import { useUndownloadableMediaHandler } from '../../hooks/useUndownloadableMediaHandler';
export enum CurveType {
None = 0,
@@ -55,6 +57,7 @@ export type Props = {
i18n: LocalizerType;
theme?: ThemeType;
+ showMediaNoLongerAvailableToast?: () => void;
showVisualAttachment?: (attachment: AttachmentType) => void;
cancelDownload?: () => void;
startDownload?: () => void;
@@ -78,6 +81,7 @@ export function Image({
i18n,
noBackground,
noBorder,
+ showMediaNoLongerAvailableToast,
showVisualAttachment,
startDownload,
cancelDownload,
@@ -164,6 +168,9 @@ export function Image({
},
[startDownload]
);
+ const undownloadableClick = useUndownloadableMediaHandler(
+ showMediaNoLongerAvailableToast
+ );
const imageOrBlurHash = url ? (
![]()
{imageOrBlurHash}
- {startDownloadButton}
+ {isMediaDownloadable ? (
+ startDownloadButton
+ ) : (
+
+ )}
{spinner}
{attachment.caption ? (
@@ -245,7 +266,9 @@ export function Image({
}}
/>
) : null}
- {(attachment.path || isIncremental(attachment)) && playIconOverlay ? (
+ {(attachment.path || isIncremental(attachment)) &&
+ isMediaDownloadable &&
+ playIconOverlay ? (
@@ -267,7 +290,9 @@ export function Image({
style={curveStyles}
/>
) : null}
- {showVisualAttachment && isReadyToView(attachment) ? (
+ {showVisualAttachment &&
+ isReadyToView(attachment) &&
+ isMediaDownloadable ? (
);
@@ -1043,11 +1047,13 @@ export class Message extends React.PureComponent