Forward Modal: Show saved messages chat (#4897)
This commit is contained in:
parent
4d62237761
commit
53ef4deaa3
@ -83,10 +83,13 @@ const RecipientPicker: FC<OwnProps & StateProps> = ({
|
||||
return chat && getCanPostInChat(chat, MAIN_THREAD_ID, undefined, chatFullInfoById[id]);
|
||||
});
|
||||
|
||||
const sorted = sortChatIds(unique([
|
||||
...filterChatsByName(lang, chatIds, chatsById, search, currentUserId),
|
||||
...(contactIds && filter.includes('users') ? filterUsersByName(contactIds, usersById, search) : []),
|
||||
]), undefined, priorityIds);
|
||||
const sorted = [
|
||||
...(currentUserId ? [currentUserId] : []),
|
||||
...sortChatIds(unique([
|
||||
...filterChatsByName(lang, chatIds, chatsById, search, currentUserId),
|
||||
...(contactIds && filter.includes('users') ? filterUsersByName(contactIds, usersById, search) : []),
|
||||
]), undefined, priorityIds),
|
||||
];
|
||||
|
||||
return filterChatIdsByType(global, sorted, filter);
|
||||
}, [pinnedIds, currentUserId, activeListIds, search, archivedListIds, lang, contactIds, filter, isOpen]);
|
||||
|
||||
@ -97,19 +97,19 @@ export function selectIsTrustedBot<T extends GlobalState>(global: T, botId: stri
|
||||
}
|
||||
|
||||
export function selectChatType<T extends GlobalState>(global: T, chatId: string) : ApiChatType | undefined {
|
||||
const chat = selectChat(global, chatId);
|
||||
if (!chat) return undefined;
|
||||
|
||||
const bot = selectBot(global, chatId);
|
||||
if (bot) {
|
||||
return 'bots';
|
||||
}
|
||||
|
||||
const user = selectChatUser(global, chat);
|
||||
const user = selectUser(global, chatId);
|
||||
if (user) {
|
||||
return 'users';
|
||||
}
|
||||
|
||||
const chat = selectChat(global, chatId);
|
||||
if (!chat) return undefined;
|
||||
|
||||
if (isChatChannel(chat)) {
|
||||
return 'channels';
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user