Don't send typing notification when restoring composer draft (#7477)

pull/21833/head
Michael Telatynski 2022-01-07 11:15:20 +00:00 committed by GitHub
parent fed53a268b
commit 9fd933a0b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -234,7 +234,8 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
}); });
this.historyManager.tryPush(this.props.model, selection, inputType, diff); this.historyManager.tryPush(this.props.model, selection, inputType, diff);
let isTyping = !this.props.model.isEmpty; // inputType is falsy during initial mount, don't consider re-loading the draft as typing
let isTyping = !this.props.model.isEmpty && !!inputType;
// If the user is entering a command, only consider them typing if it is one which sends a message into the room // If the user is entering a command, only consider them typing if it is one which sends a message into the room
if (isTyping && this.props.model.parts[0].type === "command") { if (isTyping && this.props.model.parts[0].type === "command") {
const { cmd } = parseCommandString(this.props.model.parts[0].text); const { cmd } = parseCommandString(this.props.model.parts[0].text);