mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Use libsignal-client for username validation
This commit is contained in:
@@ -91,13 +91,13 @@ export class LeftPaneChooseGroupMembersHelper extends LeftPaneHelper<LeftPaneCho
|
||||
isShowingRecommendedGroupSizeModal;
|
||||
this.searchTerm = searchTerm;
|
||||
|
||||
if (isUsernamesEnabled) {
|
||||
const username = getUsernameFromSearch(searchTerm);
|
||||
const isVisible = this.candidateContacts.every(
|
||||
contact => contact.username !== username
|
||||
);
|
||||
const username = getUsernameFromSearch(searchTerm);
|
||||
const isUsernameVisible =
|
||||
username !== undefined &&
|
||||
this.candidateContacts.every(contact => contact.username !== username);
|
||||
|
||||
if (isVisible) {
|
||||
if (isUsernamesEnabled) {
|
||||
if (isUsernameVisible) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ export class LeftPaneChooseGroupMembersHelper extends LeftPaneHelper<LeftPaneCho
|
||||
}
|
||||
|
||||
const phoneNumber = parseAndFormatPhoneNumber(searchTerm, regionCode);
|
||||
if (!this.username && phoneNumber) {
|
||||
if (!isUsernameVisible && phoneNumber) {
|
||||
this.isPhoneNumberChecked =
|
||||
phoneNumber.isValid &&
|
||||
selectedContacts.some(contact => contact.e164 === phoneNumber.e164);
|
||||
|
||||
Reference in New Issue
Block a user