More permissive username search

This commit is contained in:
Fedor Indutny
2024-02-14 10:18:49 -08:00
committed by GitHub
parent 89525d3e16
commit 4a41e87173
17 changed files with 121 additions and 31 deletions

View File

@@ -12,7 +12,6 @@ import { omit } from 'lodash';
import type { ListRowProps } from 'react-virtualized';
import type { LocalizerType, ThemeType } from '../../../../types/Util';
import { getUsernameFromSearch } from '../../../../types/Username';
import { strictAssert, assertDev } from '../../../../util/assert';
import { refMerger } from '../../../../util/refMerger';
import { useRestoreFocus } from '../../../../hooks/useRestoreFocus';
@@ -59,6 +58,7 @@ export type StatePropsType = {
ourUsername: string | undefined;
searchTerm: string;
selectedContacts: ReadonlyArray<ConversationType>;
username: string | undefined;
confirmAdds: () => void;
onClose: () => void;
@@ -96,11 +96,10 @@ export function ChooseGroupMembersModal({
toggleSelectedContact,
lookupConversationWithoutServiceId,
showUserNotFoundModal,
username,
}: PropsType): JSX.Element {
const [focusRef] = useRestoreFocus();
const username = getUsernameFromSearch(searchTerm);
const isUsernameChecked = selectedContacts.some(
contact => contact.username === username
);