store composer state when typing in new composer

this doesn't use the MessageComposerStore on purpose so that
both the new and old composer don't overwrite each others state,
as the format is different.
This commit is contained in:
Bruno Windels 2019-08-21 17:42:09 +02:00
parent 9f72268df7
commit b366b0b3d8
2 changed files with 34 additions and 1 deletions

View file

@ -52,6 +52,7 @@ function selectionEquals(a: Selection, b: Selection): boolean {
export default class BasicMessageEditor extends React.Component {
static propTypes = {
onChange: PropTypes.func,
model: PropTypes.instanceOf(EditorModel).isRequired,
room: PropTypes.instanceOf(Room).isRequired,
placeholder: PropTypes.string,
@ -91,6 +92,10 @@ export default class BasicMessageEditor extends React.Component {
this.setState({autoComplete: this.props.model.autoComplete});
this.historyManager.tryPush(this.props.model, caret, inputType, diff);
TypingStore.sharedInstance().setSelfTyping(this.props.room.roomId, !this.props.model.isEmpty);
if (this.props.onChange) {
this.props.onChange();
}
}
_onInput = (event) => {