PLT-2064 Slash command hints don't autocomplete

This commit is contained in:
Alan Mooiman
2016-02-29 15:49:10 -08:00
parent 2f53edb2fd
commit 7ead702e39
2 changed files with 4 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ class CommandSuggestion extends React.Component {
onClick={onClick}
>
<div className='command__title'>
<string>{item.suggestion}</string>
<string>{item.suggestion} {item.hint}</string>
</div>
<div className='command__desc'>
{item.description}

View File

@@ -787,11 +787,13 @@ export function getSuggestedCommands(command, suggestionId, component) {
data.forEach((cmd) => {
if (('/' + cmd.trigger).indexOf(command) === 0) {
let s = '/' + cmd.trigger;
let hint = '';
if (cmd.auto_complete_hint && cmd.auto_complete_hint.length !== 0) {
s += ' ' + cmd.auto_complete_hint;
hint = cmd.auto_complete_hint;
}
matches.push({
suggestion: s,
hint,
description: cmd.auto_complete_desc
});
}