Merge pull request #1341 from hmhealey/plt911

PLT-911 Fixed navigating search autocomplete with the keyboard
Этот коммит содержится в:
Joram Wilander
2015-11-06 12:39:56 -05:00
родитель 8d7f1c1705 6ba996a9e2
Коммит ed2537c4b5

Просмотреть файл

@@ -189,7 +189,16 @@ export default class SearchAutocomplete extends React.Component {
channels = channels.filter((channel) => channel.type !== 'D');
}
channels.sort((a, b) => a.name.localeCompare(b.name));
channels.sort((a, b) => {
// put public channels first and then sort alphabebetically
if (a.type === b.type) {
return a.name.localeCompare(b.name);
} else if (a.type === Constants.OPEN_CHANNEL) {
return -1;
}
return 1;
});
suggestions = channels;
} else if (mode === 'users') {