Fix LHS group message sorting (#5812)
Этот коммит содержится в:
коммит произвёл
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;
|
||||
|
||||
Ссылка в новой задаче
Block a user