[FIX] Send thread attachment (#2242)
This commit is contained in:
parent
a7e7d1fdcb
commit
6abfbf615f
|
@ -632,7 +632,14 @@ class MessageBox extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
openShareView = (attachments) => {
|
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 = () => {
|
createDiscussion = () => {
|
||||||
|
|
|
@ -36,7 +36,7 @@ const styles = StyleSheet.create({
|
||||||
|
|
||||||
const Header = React.memo(({ room, thread, theme }) => {
|
const Header = React.memo(({ room, thread, theme }) => {
|
||||||
let type;
|
let type;
|
||||||
if (thread?.tmid) {
|
if (thread?.id) {
|
||||||
type = 'thread';
|
type = 'thread';
|
||||||
} else if (room?.prid) {
|
} else if (room?.prid) {
|
||||||
type = 'discussion';
|
type = 'discussion';
|
||||||
|
|
|
@ -189,7 +189,7 @@ class ShareView extends Component {
|
||||||
path,
|
path,
|
||||||
store: 'Uploads'
|
store: 'Uploads'
|
||||||
},
|
},
|
||||||
thread?.tmid,
|
thread?.id,
|
||||||
server,
|
server,
|
||||||
{ id: user.id, token: user.token }
|
{ id: user.id, token: user.token }
|
||||||
);
|
);
|
||||||
|
@ -199,7 +199,7 @@ class ShareView extends Component {
|
||||||
|
|
||||||
// Send text message
|
// Send text message
|
||||||
} else if (text.length) {
|
} 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 {
|
} catch {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
|
Loading…
Reference in New Issue