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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 121 additions and 31 deletions

View file

@ -12,7 +12,6 @@ import { SearchInput } from '../SearchInput';
import type { LocalizerType } from '../../types/Util';
import type { ParsedE164Type } from '../../util/libphonenumberInstance';
import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance';
import { getUsernameFromSearch } from '../../types/Username';
import type { UUIDFetchStateType } from '../../util/uuidFetchState';
import {
isFetchingByUsername,
@ -27,6 +26,7 @@ export type LeftPaneComposePropsType = {
regionCode: string | undefined;
searchTerm: string;
uuidFetchState: UUIDFetchStateType;
username: string | undefined;
};
enum TopButtons {
@ -57,6 +57,7 @@ export class LeftPaneComposeHelper extends LeftPaneHelper<LeftPaneComposePropsTy
regionCode,
searchTerm,
uuidFetchState,
username,
}: Readonly<LeftPaneComposePropsType>) {
super();
@ -65,8 +66,6 @@ export class LeftPaneComposeHelper extends LeftPaneHelper<LeftPaneComposePropsTy
this.searchTerm = searchTerm;
this.uuidFetchState = uuidFetchState;
const username = getUsernameFromSearch(this.searchTerm);
this.username = username;
this.isUsernameVisible =
Boolean(username) &&