mirror of https://github.com/vector-im/riot-web
simplify arrow func
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
5bf3e5b00a
commit
9107744da7
|
@ -43,8 +43,7 @@ export default class CommandProvider extends AutocompleteProvider {
|
||||||
|
|
||||||
// if the query is just `/` (and the user hit TAB or waits), show them all COMMANDS otherwise FuzzyMatch them
|
// if the query is just `/` (and the user hit TAB or waits), show them all COMMANDS otherwise FuzzyMatch them
|
||||||
const matches = query === '/' ? COMMANDS : this.matcher.match(command[1]);
|
const matches = query === '/' ? COMMANDS : this.matcher.match(command[1]);
|
||||||
return matches.map((result) => {
|
return matches.map((result) => ({
|
||||||
return {
|
|
||||||
// If the command is the same as the one they entered, we don't want to discard their arguments
|
// If the command is the same as the one they entered, we don't want to discard their arguments
|
||||||
completion: result.command === command[1] ? command[0] : (result.command + ' '),
|
completion: result.command === command[1] ? command[0] : (result.command + ' '),
|
||||||
component: <TextualCompletion
|
component: <TextualCompletion
|
||||||
|
@ -52,8 +51,7 @@ export default class CommandProvider extends AutocompleteProvider {
|
||||||
subtitle={result.args}
|
subtitle={result.args}
|
||||||
description={_t(result.description)} />,
|
description={_t(result.description)} />,
|
||||||
range,
|
range,
|
||||||
};
|
}));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getName() {
|
getName() {
|
||||||
|
|
Loading…
Reference in New Issue