Added composerEmpty property

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-02-12 15:39:54 +01:00
parent 98757bb6cf
commit 42a48ee27d
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 8 additions and 0 deletions

View File

@ -282,6 +282,7 @@ export default class MessageComposer extends React.Component {
showSendButton: SettingsStore.getValue("MessageComposerInput.showSendButton"),
hasConference: WidgetStore.instance.doesRoomHaveConference(this.props.room),
joinedConference: WidgetStore.instance.isJoinedToConferenceIn(this.props.room),
composerEmpty: true,
};
}
@ -423,6 +424,12 @@ export default class MessageComposer extends React.Component {
this.messageComposerInput._sendMessage();
}
onIsEmptyChanged = (isEmpty) => {
this.setState({
composerEmpty: isEmpty,
});
}
render() {
const controls = [
this.state.me ? <ComposerAvatar key="controls_avatar" me={this.state.me} /> : null,
@ -448,6 +455,7 @@ export default class MessageComposer extends React.Component {
resizeNotifier={this.props.resizeNotifier}
permalinkCreator={this.props.permalinkCreator}
replyToEvent={this.props.replyToEvent}
onIsEmptyChanged={this.onIsEmptyChanged}
/>,
<UploadButton key="controls_upload" roomId={this.props.room.roomId} />,
<EmojiButton key="emoji_button" addEmoji={this.addEmoji} />,