Use fewer functions for typing in the composer
This commit is contained in:
parent
17ed62de7d
commit
8bb860e870
1 changed files with 2 additions and 14 deletions
|
@ -424,18 +424,6 @@ export default class MessageComposerInput extends React.Component {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onTypingActivity() {
|
|
||||||
this.sendTyping(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
onFinishedTyping() {
|
|
||||||
this.sendTyping(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
sendTyping(isTyping) {
|
|
||||||
TypingStore.sharedInstance().setSelfTyping(this.props.room.roomId, isTyping);
|
|
||||||
}
|
|
||||||
|
|
||||||
onChange = (change: Change, originalEditorState?: Value) => {
|
onChange = (change: Change, originalEditorState?: Value) => {
|
||||||
let editorState = change.value;
|
let editorState = change.value;
|
||||||
|
|
||||||
|
@ -466,9 +454,9 @@ export default class MessageComposerInput extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Plain.serialize(editorState) !== '') {
|
if (Plain.serialize(editorState) !== '') {
|
||||||
this.onTypingActivity();
|
TypingStore.sharedInstance().setSelfTyping(this.props.room.roomId, true);
|
||||||
} else {
|
} else {
|
||||||
this.onFinishedTyping();
|
TypingStore.sharedInstance().setSelfTyping(this.props.room.roomId, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editorState.startText !== null) {
|
if (editorState.startText !== null) {
|
||||||
|
|
Loading…
Reference in a new issue