Forward Modal: Show saved messages chat (#4897)

This commit is contained in:
Alexander Zinchuk 2024-08-29 15:52:46 +02:00
parent 4d62237761
commit 53ef4deaa3
2 changed files with 11 additions and 8 deletions

View File

@ -83,10 +83,13 @@ const RecipientPicker: FC<OwnProps & StateProps> = ({
return chat && getCanPostInChat(chat, MAIN_THREAD_ID, undefined, chatFullInfoById[id]); return chat && getCanPostInChat(chat, MAIN_THREAD_ID, undefined, chatFullInfoById[id]);
}); });
const sorted = sortChatIds(unique([ const sorted = [
...filterChatsByName(lang, chatIds, chatsById, search, currentUserId), ...(currentUserId ? [currentUserId] : []),
...(contactIds && filter.includes('users') ? filterUsersByName(contactIds, usersById, search) : []), ...sortChatIds(unique([
]), undefined, priorityIds); ...filterChatsByName(lang, chatIds, chatsById, search, currentUserId),
...(contactIds && filter.includes('users') ? filterUsersByName(contactIds, usersById, search) : []),
]), undefined, priorityIds),
];
return filterChatIdsByType(global, sorted, filter); return filterChatIdsByType(global, sorted, filter);
}, [pinnedIds, currentUserId, activeListIds, search, archivedListIds, lang, contactIds, filter, isOpen]); }, [pinnedIds, currentUserId, activeListIds, search, archivedListIds, lang, contactIds, filter, isOpen]);

View File

@ -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 { 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); const bot = selectBot(global, chatId);
if (bot) { if (bot) {
return 'bots'; return 'bots';
} }
const user = selectChatUser(global, chat); const user = selectUser(global, chatId);
if (user) { if (user) {
return 'users'; return 'users';
} }
const chat = selectChat(global, chatId);
if (!chat) return undefined;
if (isChatChannel(chat)) { if (isChatChannel(chat)) {
return 'channels'; return 'channels';
} }