From b1091a22a3777392ed39e98b619de9d71e0a35d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 13 Apr 2021 08:11:09 +0200 Subject: [PATCH] Don't render context menu button if mxEvent is missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The button is useless and doesn't work if we're viewing an avatar Signed-off-by: Šimon Brandner --- src/components/views/elements/ImageView.tsx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/views/elements/ImageView.tsx b/src/components/views/elements/ImageView.tsx index 05e71b67bf..35f494025c 100644 --- a/src/components/views/elements/ImageView.tsx +++ b/src/components/views/elements/ImageView.tsx @@ -359,6 +359,19 @@ export default class ImageView extends React.Component { ); } + let contextMenuButton; + if (this.props.mxEvent) { + contextMenuButton = ( + + ); + } + return ( { title={_t("Download")} onClick={ this.onDownloadClick }> - + {contextMenuButton}