From a0a604618c6b399e193f1c42065516ed7d4f2f7c Mon Sep 17 00:00:00 2001 From: Jaiwanth Date: Mon, 31 May 2021 23:50:55 +0530 Subject: [PATCH] Handle non-media attachments --- src/components/views/messages/MFileBody.js | 10 +++++++++- src/components/views/rooms/EventTile.tsx | 2 +- src/utils/exportUtils/HtmlExport.tsx | 8 ++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/views/messages/MFileBody.js b/src/components/views/messages/MFileBody.js index 9dc1de7683..53d37d73da 100644 --- a/src/components/views/messages/MFileBody.js +++ b/src/components/views/messages/MFileBody.js @@ -102,6 +102,8 @@ export default class MFileBody extends React.Component { tileShape: PropTypes.string, /* whether or not to show the default placeholder for the file. Defaults to true. */ showGenericPlaceholder: PropTypes.bool, + /* to set source to local file path during export */ + mediaSrc: PropTypes.string, }; static defaultProps = { @@ -178,7 +180,13 @@ export default class MFileBody extends React.Component { ); } - if (isEncrypted) { + if (this.props.mediaSrc) { + return + + { placeholder } + + ; + } else if (isEncrypted) { if (this.state.decryptedBlob === null) { // Need to decrypt the attachment // Wait for the user to click on the link before downloading diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index be748d6b71..a7bfb40ad0 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -936,7 +936,7 @@ export default class EventTile extends React.Component { avatar = (