Sort by recency then alphabetically everywhere

This commit is contained in:
Jamie Kyle 2024-03-18 16:31:42 -07:00 committed by GitHub
parent 9aff86f02b
commit 53ae88c777
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 195 additions and 177 deletions

View file

@ -19,7 +19,7 @@ import { missingCaseError } from '../../../../util/missingCaseError';
import type { LookupConversationWithoutServiceIdActionsType } from '../../../../util/lookupConversationWithoutServiceId';
import { parseAndFormatPhoneNumber } from '../../../../util/libphonenumberInstance';
import type { ParsedE164Type } from '../../../../util/libphonenumberInstance';
import { filterAndSortConversationsByRecent } from '../../../../util/filterAndSortConversations';
import { filterAndSortConversations } from '../../../../util/filterAndSortConversations';
import type { ConversationType } from '../../../../state/ducks/conversations';
import type {
UUIDFetchStateKeyType,
@ -140,13 +140,13 @@ export function ChooseGroupMembersModal({
const canContinue = Boolean(selectedContacts.length);
const [filteredContacts, setFilteredContacts] = useState(
filterAndSortConversationsByRecent(candidateContacts, '', regionCode)
filterAndSortConversations(candidateContacts, '', regionCode)
);
const normalizedSearchTerm = searchTerm.trim();
useEffect(() => {
const timeout = setTimeout(() => {
setFilteredContacts(
filterAndSortConversationsByRecent(
filterAndSortConversations(
candidateContacts,
normalizedSearchTerm,
regionCode