@@ -5,7 +5,7 @@ import type {LocaleContextProps} from '@components/LocaleContextProvider';
55import type { SubstitutionMap } from '@components/Search/SearchRouter/getQueryWithSubstitutions' ;
66import { getSubstitutionMapKey , getSubstitutionMapKeyWithIndex } from '@components/Search/SearchRouter/getQueryWithSubstitutions' ;
77import type { SearchFilterKey , UserFriendlyKey } from '@components/Search/types' ;
8- import { getBankAccountSearchLabel , getSearchEligibleBankAccounts } from '@libs/BankAccountUtils' ;
8+ import { getBankAccountSearchLabel , isBankAccountPartiallySetup } from '@libs/BankAccountUtils' ;
99import { getCardFeedsForDisplay } from '@libs/CardFeedUtils' ;
1010import { getCardDescription , isCard , isCardHiddenFromSearch } from '@libs/CardUtils' ;
1111import { getDecodedCategoryName } from '@libs/CategoryUtils' ;
@@ -426,13 +426,18 @@ function useAutocompleteSuggestions({
426426 } ) ) ;
427427 }
428428 case CONST . SEARCH . SYNTAX_FILTER_KEYS . BANK_ACCOUNT : {
429- const bankAccounts = Object . values ( getSearchEligibleBankAccounts ( bankAccountList ) ) ;
430429 const bankAccountSuggestions : Array < { id : string ; label : string ; accountNumber : string } > = [ ] ;
431- for ( const bankAccount of bankAccounts ) {
430+ for ( const bankAccount of Object . values ( bankAccountList ?? { } ) ) {
432431 const bankAccountID = bankAccount ?. accountData ?. bankAccountID ;
433432 if ( ! bankAccountID ) {
434433 continue ;
435434 }
435+ if ( bankAccount ?. accountData ?. type !== CONST . BANK_ACCOUNT . TYPE . BUSINESS ) {
436+ continue ;
437+ }
438+ if ( isBankAccountPartiallySetup ( bankAccount ?. accountData ?. state ) ) {
439+ continue ;
440+ }
436441 const accountNumber = bankAccount ?. accountData ?. accountNumber ?? '' ;
437442 const label = getBankAccountSearchLabel ( bankAccount ) ;
438443 bankAccountSuggestions . push ( { id : bankAccountID . toString ( ) , label, accountNumber} ) ;
0 commit comments