[FIX] Send thread attachment (#2242)

This commit is contained in:
Djorkaeff Alexandre 2020-07-03 11:07:29 -03:00 committed by GitHub
parent a7e7d1fdcb
commit 6abfbf615f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View File

@ -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 = () => {

View File

@ -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';

View File

@ -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