Этот коммит содержится в:
Joram Wilander
2017-03-24 16:41:45 -04:00
коммит произвёл Corey Hulen
родитель 5bf6ae04df
Коммит a2f78d01bd

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

@@ -102,13 +102,30 @@ export function sortChannelsByDisplayName(a, b) {
return (typeToPrefixMap[a.type] || defaultPrefix).localeCompare((typeToPrefixMap[b.type] || defaultPrefix), locale);
}
if (a.display_name !== b.display_name) {
return a.display_name.localeCompare(b.display_name, locale, {numeric: true});
const aDisplayName = getChannelDisplayName(a);
const bDisplayName = getChannelDisplayName(b);
if (aDisplayName !== bDisplayName) {
return aDisplayName.localeCompare(bDisplayName, locale, {numeric: true});
}
return a.name.localeCompare(b.name, locale, {numeric: true});
}
function getChannelDisplayName(channel) {
if (channel.type !== Constants.GM_CHANNEL) {
return channel.display_name;
}
const currentUser = UserStore.getCurrentUser();
if (currentUser) {
return channel.display_name.replace(currentUser.username + ', ', '');
}
return channel.display_name;
}
export function showCreateOption(channelType, isAdmin, isSystemAdmin) {
if (global.window.mm_license.IsLicensed !== 'true') {
return true;