Merge pull request #3374 from matrix-org/bwindels/fix-cider-command-detection
New composer: make command detection not break with pill candidates in commandpull/21833/head
commit
ff74dd4b7f
|
@ -163,10 +163,7 @@ export default class SendMessageComposer extends React.Component {
|
||||||
|
|
||||||
_isSlashCommand() {
|
_isSlashCommand() {
|
||||||
const parts = this.model.parts;
|
const parts = this.model.parts;
|
||||||
const isPlain = parts.reduce((isPlain, part) => {
|
return parts.length && parts[0].type === "command";
|
||||||
return isPlain && (part.type === "command" || part.type === "plain" || part.type === "newline");
|
|
||||||
}, true);
|
|
||||||
return isPlain && parts.length > 0 && parts[0].text.startsWith("/");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async _runSlashCommand() {
|
async _runSlashCommand() {
|
||||||
|
|
Loading…
Reference in New Issue