mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
onIsEmptyChanged() -> onChange()
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
9420cc35cc
commit
a7847f2514
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user