Invalid handle autocomplete (#2251)
* refactor invalid handle check from a previous PR to use util function * add invalid handle check to `prefixMatch`
This commit is contained in:
parent
946b2c9163
commit
4a93a5b6ad
3 changed files with 6 additions and 3 deletions
|
@ -11,6 +11,7 @@ import {
|
|||
getModerationOpts,
|
||||
useModerationOpts,
|
||||
} from './preferences'
|
||||
import {isInvalidHandle} from '#/lib/strings/handles'
|
||||
|
||||
const DEFAULT_MOD_OPTS = getModerationOpts({
|
||||
userDid: '',
|
||||
|
@ -119,7 +120,7 @@ function prefixMatch(
|
|||
prefix: string,
|
||||
info: AppBskyActorDefs.ProfileViewBasic,
|
||||
): boolean {
|
||||
if (info.handle.includes(prefix)) {
|
||||
if (!isInvalidHandle(info.handle) && info.handle.includes(prefix)) {
|
||||
return true
|
||||
}
|
||||
if (info.displayName?.toLocaleLowerCase().includes(prefix)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue