From e4d645e36002ad98d39a671cc0b3f9a2b7a1a302 Mon Sep 17 00:00:00 2001 From: Germain Date: Fri, 19 Nov 2021 09:07:12 +0000 Subject: [PATCH] Hide MFileBody download link for threaded messages (#7127) Co-authored-by: Travis Ralston --- src/components/views/messages/MImageBody.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/views/messages/MImageBody.tsx b/src/components/views/messages/MImageBody.tsx index d8f2f7c655..543c383283 100644 --- a/src/components/views/messages/MImageBody.tsx +++ b/src/components/views/messages/MImageBody.tsx @@ -35,6 +35,7 @@ import classNames from 'classnames'; import { CSSTransition, SwitchTransition } from 'react-transition-group'; import { logger } from "matrix-js-sdk/src/logger"; +import { TileShape } from '../rooms/EventTile'; import { ImageSize, suggestedSize as suggestedImageSize } from "../../../settings/enums/ImageSize"; interface IState { @@ -517,8 +518,14 @@ export default class MImageBody extends React.Component { // Overidden by MStickerBody protected getFileBody(): string | JSX.Element { if (this.props.forExport) return null; - // We only ever need the download bar if we're appearing outside of the timeline - if (this.props.tileShape) { + /* + * In the room timeline or the thread context we don't need the download + * link as the message action bar will fullfil that + */ + const hasMessageActionBar = !this.props.tileShape + || this.props.tileShape === TileShape.Thread + || this.props.tileShape === TileShape.ThreadPanel; + if (!hasMessageActionBar) { return ; } }