You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
onIsEmptyChanged() -> onChange()
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -415,9 +415,10 @@ export default class MessageComposer extends React.Component {
|
||||
this.messageComposerInput._sendMessage();
|
||||
}
|
||||
|
||||
onIsEmptyChanged = (isEmpty) => {
|
||||
onChange = () => {
|
||||
if (!this.messageComposerInput) return;
|
||||
this.setState({
|
||||
isComposerEmpty: isEmpty,
|
||||
isComposerEmpty: this.messageComposerInput.model.isEmpty,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -446,7 +447,7 @@ export default class MessageComposer extends React.Component {
|
||||
resizeNotifier={this.props.resizeNotifier}
|
||||
permalinkCreator={this.props.permalinkCreator}
|
||||
replyToEvent={this.props.replyToEvent}
|
||||
onIsEmptyChanged={this.onIsEmptyChanged}
|
||||
onChange={this.onChange}
|
||||
/>,
|
||||
<UploadButton key="controls_upload" roomId={this.props.room.roomId} />,
|
||||
<EmojiButton key="emoji_button" addEmoji={this.addEmoji} />,
|
||||
|
||||
@@ -117,7 +117,7 @@ export default class SendMessageComposer extends React.Component {
|
||||
placeholder: PropTypes.string,
|
||||
permalinkCreator: PropTypes.object.isRequired,
|
||||
replyToEvent: PropTypes.object,
|
||||
onIsEmptyChanged: PropTypes.func,
|
||||
onChange: PropTypes.func,
|
||||
};
|
||||
|
||||
static contextType = MatrixClientContext;
|
||||
@@ -538,9 +538,7 @@ export default class SendMessageComposer extends React.Component {
|
||||
}
|
||||
|
||||
onChange = () => {
|
||||
if (this.props.onIsEmptyChanged) {
|
||||
this.props.onIsEmptyChanged(this.model.isEmpty);
|
||||
}
|
||||
if (this.props.onChange) this.props.onChange();
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user