diff --git a/app/containers/MessageBox/index.js b/app/containers/MessageBox/index.js index b07626eac..87270fb0d 100644 --- a/app/containers/MessageBox/index.js +++ b/app/containers/MessageBox/index.js @@ -632,7 +632,14 @@ class MessageBox extends Component { } openShareView = (attachments) => { - Navigation.navigate('ShareView', { room: this.room, thread: this.thread, attachments }); + const { message, replyCancel, replyWithMention } = this.props; + // Start a thread with an attachment + let { thread } = this; + if (replyWithMention) { + thread = message; + replyCancel(); + } + Navigation.navigate('ShareView', { room: this.room, thread, attachments }); } createDiscussion = () => { diff --git a/app/views/ShareView/Header.js b/app/views/ShareView/Header.js index afcc5b4a7..7d0312b95 100644 --- a/app/views/ShareView/Header.js +++ b/app/views/ShareView/Header.js @@ -36,7 +36,7 @@ const styles = StyleSheet.create({ const Header = React.memo(({ room, thread, theme }) => { let type; - if (thread?.tmid) { + if (thread?.id) { type = 'thread'; } else if (room?.prid) { type = 'discussion'; diff --git a/app/views/ShareView/index.js b/app/views/ShareView/index.js index fad214472..a31b962e4 100644 --- a/app/views/ShareView/index.js +++ b/app/views/ShareView/index.js @@ -189,7 +189,7 @@ class ShareView extends Component { path, store: 'Uploads' }, - thread?.tmid, + thread?.id, server, { id: user.id, token: user.token } ); @@ -199,7 +199,7 @@ class ShareView extends Component { // Send text message } else if (text.length) { - await RocketChat.sendMessage(room.rid, text, thread?.tmid, { id: user.id, token: user.token }); + await RocketChat.sendMessage(room.rid, text, thread?.id, { id: user.id, token: user.token }); } } catch { // Do nothing