Do not show non-autocomplete commands for system admins (#7094)

This commit is contained in:
Joram Wilander
2017-08-02 17:07:30 -04:00
committed by GitHub
parent 873e4f4903
commit eee711145c

View File

@@ -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;