From eee711145cb0b466dc8ccca886d1f67cd83cdfdc Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 2 Aug 2017 17:07:30 -0400 Subject: [PATCH] Do not show non-autocomplete commands for system admins (#7094) --- webapp/actions/integration_actions.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/actions/integration_actions.jsx b/webapp/actions/integration_actions.jsx index 6afaa57890..c9bba92027 100644 --- a/webapp/actions/integration_actions.jsx +++ b/webapp/actions/integration_actions.jsx @@ -213,8 +213,12 @@ export function regenCommandToken(id) { export function getSuggestedCommands(command, suggestionId, component) { Client4.getCommandsList(TeamStore.getCurrentId()).then( (data) => { - var matches = []; + let matches = []; data.forEach((cmd) => { + if (!cmd.auto_complete) { + return; + } + if (cmd.trigger !== 'shortcuts' || !UserAgent.isMobile()) { if (('/' + cmd.trigger).indexOf(command) === 0) { const s = '/' + cmd.trigger;