You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-19 05:22:13 +03:00
put dispatches together
This commit is contained in:
@@ -41,13 +41,6 @@ function addReplyToMessageContent(content, repliedToEvent, permalinkCreator) {
|
|||||||
}
|
}
|
||||||
content.body = nestedReply.body + content.body;
|
content.body = nestedReply.body + content.body;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear reply_to_event as we put the message into the queue
|
|
||||||
// if the send fails, retry will handle resending.
|
|
||||||
dis.dispatch({
|
|
||||||
action: 'reply_to_event',
|
|
||||||
event: null,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMessageContent(model, permalinkCreator) {
|
function createMessageContent(model, permalinkCreator) {
|
||||||
@@ -103,9 +96,18 @@ export default class SendMessageComposer extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_sendMessage() {
|
_sendMessage() {
|
||||||
|
const isReply = !!RoomViewStore.getQuotingEvent();
|
||||||
const {roomId} = this.props.room;
|
const {roomId} = this.props.room;
|
||||||
this.context.matrixClient.sendMessage(roomId, createMessageContent(this.model, this.props.permalinkCreator));
|
this.context.matrixClient.sendMessage(roomId, createMessageContent(this.model, this.props.permalinkCreator));
|
||||||
this.model.reset([]);
|
this.model.reset([]);
|
||||||
|
if (isReply) {
|
||||||
|
// Clear reply_to_event as we put the message into the queue
|
||||||
|
// if the send fails, retry will handle resending.
|
||||||
|
dis.dispatch({
|
||||||
|
action: 'reply_to_event',
|
||||||
|
event: null,
|
||||||
|
});
|
||||||
|
}
|
||||||
dis.dispatch({action: 'focus_composer'});
|
dis.dispatch({action: 'focus_composer'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user