If no bug_report_endpoint_url, hide rageshaking from the App

This commit is contained in:
Michael Telatynski 2020-09-15 15:49:25 +01:00
parent 9a3c30b1f1
commit 6c166f0560
5 changed files with 33 additions and 15 deletions

View file

@ -47,7 +47,7 @@ export default class CommandProvider extends AutocompleteProvider {
if (command[0] !== command[1]) {
// The input looks like a command with arguments, perform exact match
const name = command[1].substr(1); // strip leading `/`
if (CommandMap.has(name)) {
if (CommandMap.has(name) && CommandMap.get(name).isEnabled()) {
// some commands, namely `me` and `ddg` don't suit having the usage shown whilst typing their arguments
if (CommandMap.get(name).hideCompletionAfterSpace) return [];
matches = [CommandMap.get(name)];
@ -63,7 +63,7 @@ export default class CommandProvider extends AutocompleteProvider {
}
return matches.map((result) => {
return matches.filter(cmd => cmd.isEnabled()).map((result) => {
let completion = result.getCommand() + ' ';
const usedAlias = result.aliases.find(alias => `/${alias}` === command[1]);
// If the command (or an alias) is the same as the one they entered, we don't want to discard their arguments