Left Search: Add limit for contacts search (#4029)

This commit is contained in:
Alexander Zinchuk 2023-12-04 14:38:58 +01:00
parent 01269036f4
commit 0411e251fe
2 changed files with 3 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import {
ARCHIVED_FOLDER_ID,
DEBUG,
GENERAL_TOPIC_ID,
GLOBAL_SEARCH_CONTACTS_LIMIT,
MAX_INT_32,
MEMBERS_LOAD_SLICE,
SERVICE_NOTIFICATIONS_USER_ID,
@ -242,7 +243,7 @@ export async function fetchChatSettings(chat: ApiChat) {
}
export async function searchChats({ query }: { query: string }) {
const result = await invokeRequest(new GramJs.contacts.Search({ q: query }));
const result = await invokeRequest(new GramJs.contacts.Search({ q: query, limit: GLOBAL_SEARCH_CONTACTS_LIMIT }));
if (!result) {
return undefined;
}

View File

@ -78,6 +78,7 @@ export const SHARED_MEDIA_SLICE = 42;
export const MESSAGE_SEARCH_SLICE = 42;
export const GLOBAL_SEARCH_SLICE = 20;
export const GLOBAL_TOPIC_SEARCH_SLICE = 5;
export const GLOBAL_SEARCH_CONTACTS_LIMIT = 20;
export const MEMBERS_SLICE = 30;
export const MEMBERS_LOAD_SLICE = 200;
export const PINNED_MESSAGES_LIMIT = 50;