about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/state/queries/actor-autocomplete.ts3
-rw-r--r--src/view/screens/Profile.tsx3
-rw-r--r--src/view/shell/desktop/LeftNav.tsx3
3 files changed, 6 insertions, 3 deletions
diff --git a/src/state/queries/actor-autocomplete.ts b/src/state/queries/actor-autocomplete.ts
index fe207371d..709a15b40 100644
--- a/src/state/queries/actor-autocomplete.ts
+++ b/src/state/queries/actor-autocomplete.ts
@@ -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)) {
diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx
index f1c648a67..4558ae33d 100644
--- a/src/view/screens/Profile.tsx
+++ b/src/view/screens/Profile.tsx
@@ -39,6 +39,7 @@ import {truncateAndInvalidate} from '#/state/queries/util'
 import {Text} from '#/view/com/util/text/Text'
 import {usePalette} from 'lib/hooks/usePalette'
 import {isNative} from '#/platform/detection'
+import {isInvalidHandle} from '#/lib/strings/handles'
 
 interface SectionRef {
   scrollToTop: () => void
@@ -231,7 +232,7 @@ function ProfileScreenLoaded({
     track('ProfileScreen:PressCompose')
     const mention =
       profile.handle === currentAccount?.handle ||
-      profile.handle === 'handle.invalid'
+      isInvalidHandle(profile.handle)
         ? undefined
         : profile.handle
     openComposer({mention})
diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx
index df6cb6499..f3c8c1d11 100644
--- a/src/view/shell/desktop/LeftNav.tsx
+++ b/src/view/shell/desktop/LeftNav.tsx
@@ -46,6 +46,7 @@ import {useComposerControls} from '#/state/shell/composer'
 import {useFetchHandle} from '#/state/queries/handle'
 import {emitSoftReset} from '#/state/events'
 import {NavSignupCard} from '#/view/shell/NavSignupCard'
+import {isInvalidHandle} from '#/lib/strings/handles'
 
 function ProfileCard() {
   const {currentAccount} = useSession()
@@ -221,7 +222,7 @@ function ComposeBtn() {
       if (
         !handle ||
         handle === currentAccount?.handle ||
-        handle === 'handle.invalid'
+        isInvalidHandle(handle)
       )
         return undefined