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
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue