Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/containers/MessageBox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
2 changes: 1 addition & 1 deletion app/views/ShareView/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions app/views/ShareView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class ShareView extends Component {
path,
store: 'Uploads'
},
thread?.tmid,
thread?.id,
server,
{ id: user.id, token: user.token }
);
Expand All @@ -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
Expand Down