Find by username: Don't automatically add .01 discriminator

This commit is contained in:
Scott Nonnenberg
2025-10-28 06:27:39 +10:00
committed by GitHub
parent 2ab224b0eb
commit 540bb99632
4 changed files with 103 additions and 30 deletions

View File

@@ -33,6 +33,7 @@ import {
import type { SmartDraftGifMessageSendModalProps } from '../state/smart/DraftGifMessageSendModal.preload.js';
import { CriticalIdlePrimaryDeviceModal } from './CriticalIdlePrimaryDeviceModal.dom.js';
import { LowDiskSpaceBackupImportModal } from './LowDiskSpaceBackupImportModal.dom.js';
import { isUsernameValid } from '../util/Username.dom.js';
// NOTE: All types should be required for this component so that the smart
// component gives you type errors when adding/removing props.
@@ -392,6 +393,13 @@ export function GlobalModalContainer({
content = i18n('icu:startConversation--phone-number-not-found', {
phoneNumber: userNotFoundModalState.phoneNumber,
});
} else if (
userNotFoundModalState.type === 'username' &&
!isUsernameValid(userNotFoundModalState.username)
) {
content = i18n('icu:startConversation--username-not-valid', {
atUsername: userNotFoundModalState.username,
});
} else if (userNotFoundModalState.type === 'username') {
content = i18n('icu:startConversation--username-not-found', {
atUsername: userNotFoundModalState.username,