@@ -8,7 +8,7 @@ import { Button, ButtonType, Chip, ChipType, LoadingIndicator } from '@iota/apps
88import { useCurrentWallet } from '@iota/dapp-kit' ;
99import { validateIotaName } from '@iota/iota-names-sdk' ;
1010import { usePathname , useRouter } from 'next/navigation' ;
11- import { useCallback , useEffect , useMemo , useRef , useState } from 'react' ;
11+ import { useCallback , useEffect , useMemo , useState } from 'react' ;
1212
1313import { AuctionBidDialog } from '@/auctions/components/dialogs/AuctionBidDialog' ;
1414import { useGetAuctionMetadata } from '@/auctions/hooks/useGetAuctionMetadata' ;
@@ -42,7 +42,7 @@ interface RecentSearch {
4242}
4343
4444const RECENT_SEARCHES_STORAGE_KEY = 'iota-names-recent-searches' ;
45- const DEBOUNCE_DELAY = 500 ;
45+ const DEBOUNCE_DELAY = 750 ;
4646
4747export function AvailabilityCheck ( { autoFocusInput } : AvailabilityCheckProps ) {
4848 const pathname = usePathname ( ) ;
@@ -56,7 +56,6 @@ export function AvailabilityCheck({ autoFocusInput }: AvailabilityCheckProps) {
5656 const storedRecentSearches = localStorage . getItem ( RECENT_SEARCHES_STORAGE_KEY ) ;
5757 return storedRecentSearches ? ( JSON . parse ( storedRecentSearches ) as RecentSearch [ ] ) : [ ] ;
5858 } ) ;
59- const isOnEnterSearchRef = useRef < boolean > ( false ) ;
6059
6160 const name = debouncedSearchValue ? `${ debouncedSearchValue } .iota` : '' ;
6261
@@ -106,14 +105,8 @@ export function AvailabilityCheck({ autoFocusInput }: AvailabilityCheckProps) {
106105 } , [ name ] ) ;
107106
108107 useEffect ( ( ) => {
109- if (
110- isOnEnterSearchRef . current &&
111- nameRecordData &&
112- searchValue &&
113- name === `${ searchValue } .iota`
114- ) {
108+ if ( nameRecordData && searchValue && name === `${ searchValue } .iota` ) {
115109 updateRecentSearch ( searchValue , isNameTaken ) ;
116- isOnEnterSearchRef . current = false ;
117110 }
118111 } , [ nameRecordData , isNameTaken , name , searchValue ] ) ;
119112
@@ -153,8 +146,6 @@ export function AvailabilityCheck({ autoFocusInput }: AvailabilityCheckProps) {
153146 const fullName = `${ searchValue } .iota` ;
154147 if ( fullName === name && nameRecordData ) {
155148 updateRecentSearch ( searchValue , isNameTaken ) ;
156- } else {
157- isOnEnterSearchRef . current = true ;
158149 }
159150 } , [ searchValue , validationError , isNameTaken , name , nameRecordData ] ) ;
160151
0 commit comments