From c2d513be36d79e513de672c08beb4fd035b228fb Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Wed, 7 Apr 2021 09:33:23 +0200 Subject: [PATCH] Automated cherry pick of #5278 (#5288) (cherry picked from commit c8f8d2c35c78095044c21049667e5b188942743b) Co-authored-by: Ben Schumacher --- .../app_command_parser/app_command_parser.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.ts b/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.ts index 45df306b76..00a289480f 100644 --- a/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.ts +++ b/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.ts @@ -584,8 +584,9 @@ export class AppCommandParser { const result: AutocompleteSuggestion[] = []; const bindings = this.getCommandBindings(); + for (const binding of bindings) { - let base = binding.app_id; + let base = binding.label; if (!base) { continue; } @@ -593,10 +594,11 @@ export class AppCommandParser { if (base[0] !== '/') { base = '/' + base; } + if (base.startsWith(command)) { result.push({ + Complete: binding.label, Suggestion: base, - Complete: base.substring(1), Description: binding.description || '', Hint: binding.hint || '', IconData: binding.icon || '', @@ -847,7 +849,7 @@ export class AppCommandParser { isAppCommand = (pretext: string): boolean => { const command = pretext.toLowerCase(); for (const binding of this.getCommandBindings()) { - let base = binding.app_id; + let base = binding.label; if (!base) { continue; }