Left Search: Fix search of chats (#3997)
This commit is contained in:
parent
939fff460e
commit
82af54555c
@ -7,12 +7,14 @@ import { getActions, getGlobal, withGlobal } from '../../../global';
|
|||||||
import type { ApiChat, ApiMessage } from '../../../api/types';
|
import type { ApiChat, ApiMessage } from '../../../api/types';
|
||||||
import { LoadMoreDirection } from '../../../types';
|
import { LoadMoreDirection } from '../../../types';
|
||||||
|
|
||||||
|
import { ALL_FOLDER_ID } from '../../../config';
|
||||||
import {
|
import {
|
||||||
filterChatsByName,
|
filterChatsByName,
|
||||||
filterUsersByName,
|
filterUsersByName,
|
||||||
sortChatIds,
|
sortChatIds,
|
||||||
} from '../../../global/helpers';
|
} from '../../../global/helpers';
|
||||||
import { selectTabState } from '../../../global/selectors';
|
import { selectTabState } from '../../../global/selectors';
|
||||||
|
import { getOrderedIds } from '../../../util/folderManager';
|
||||||
import { unique } from '../../../util/iteratees';
|
import { unique } from '../../../util/iteratees';
|
||||||
import { MEMO_EMPTY_ARRAY } from '../../../util/memo';
|
import { MEMO_EMPTY_ARRAY } from '../../../util/memo';
|
||||||
import { throttle } from '../../../util/schedulers';
|
import { throttle } from '../../../util/schedulers';
|
||||||
@ -131,7 +133,8 @@ const ChatResults: FC<OwnProps & StateProps> = ({
|
|||||||
const localContactIds = filterUsersByName(
|
const localContactIds = filterUsersByName(
|
||||||
contactIdsWithMe, usersById, searchQuery, currentUserId, lang('SavedMessages'),
|
contactIdsWithMe, usersById, searchQuery, currentUserId, lang('SavedMessages'),
|
||||||
);
|
);
|
||||||
const localChatIds = filterChatsByName(lang, Object.keys(chatsById), chatsById, searchQuery, currentUserId);
|
const orderedChatIds = getOrderedIds(ALL_FOLDER_ID) ?? [];
|
||||||
|
const localChatIds = filterChatsByName(lang, orderedChatIds, chatsById, searchQuery, currentUserId);
|
||||||
|
|
||||||
const localPeerIds = unique([
|
const localPeerIds = unique([
|
||||||
...localContactIds,
|
...localContactIds,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user