Merge pull request #3374 from matrix-org/bwindels/fix-cider-command-detection

New composer: make command detection not break with pill candidates in command
pull/21833/head
Bruno Windels 2019-09-02 14:58:12 +00:00 committed by GitHub
commit ff74dd4b7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -163,10 +163,7 @@ export default class SendMessageComposer extends React.Component {
_isSlashCommand() {
const parts = this.model.parts;
const isPlain = parts.reduce((isPlain, part) => {
return isPlain && (part.type === "command" || part.type === "plain" || part.type === "newline");
}, true);
return isPlain && parts.length > 0 && parts[0].text.startsWith("/");
return parts.length && parts[0].type === "command";
}
async _runSlashCommand() {