Enable usernames

This commit is contained in:
Fedor Indutny 2024-02-07 16:34:31 -08:00 committed by GitHub
parent 38da3d3152
commit 43de83f0de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 196 additions and 438 deletions

View file

@ -28,7 +28,6 @@ export type LeftPaneComposePropsType = {
regionCode: string | undefined;
searchTerm: string;
uuidFetchState: UUIDFetchStateType;
isUsernamesEnabled: boolean;
};
enum TopButton {
@ -58,7 +57,6 @@ export class LeftPaneComposeHelper extends LeftPaneHelper<LeftPaneComposePropsTy
composeGroups,
regionCode,
searchTerm,
isUsernamesEnabled,
uuidFetchState,
}: Readonly<LeftPaneComposePropsType>) {
super();
@ -70,15 +68,10 @@ export class LeftPaneComposeHelper extends LeftPaneHelper<LeftPaneComposePropsTy
const username = getUsernameFromSearch(this.searchTerm);
if (isUsernamesEnabled) {
this.username = username;
this.isUsernameVisible =
isUsernamesEnabled &&
Boolean(username) &&
this.composeContacts.every(contact => contact.username !== username);
} else {
this.isUsernameVisible = false;
}
this.username = username;
this.isUsernameVisible =
Boolean(username) &&
this.composeContacts.every(contact => contact.username !== username);
const phoneNumber = parseAndFormatPhoneNumber(searchTerm, regionCode);
if (!username && phoneNumber) {