avoid .done
and .then
anti-pattern
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
11ae0805b0
commit
db55f87699
2 changed files with 6 additions and 6 deletions
|
@ -877,11 +877,13 @@ export default class MessageComposerInput extends React.Component {
|
|||
}
|
||||
|
||||
|
||||
this.client.sendMessage(this.props.room.roomId, content).done((res) => {
|
||||
this.client.sendMessage(this.props.room.roomId, content).then((res) => {
|
||||
dis.dispatch({
|
||||
action: 'message_sent',
|
||||
});
|
||||
}, (e) => onSendMessageFailed(e, this.props.room));
|
||||
}).catch((e) => {
|
||||
onSendMessageFailed(e, this.props.room);
|
||||
});
|
||||
|
||||
this.setState({
|
||||
editorState: this.createEditorState(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue