diff --git a/src/components/Search/SearchRouter/SearchRouter.tsx b/src/components/Search/SearchRouter/SearchRouter.tsx index 85965820a729..6e28dabc8d4a 100644 --- a/src/components/Search/SearchRouter/SearchRouter.tsx +++ b/src/components/Search/SearchRouter/SearchRouter.tsx @@ -113,15 +113,6 @@ function SearchRouter({onRouterClose, shouldHideInputCaret}: SearchRouterProps) let roomType: ValueOf = CONST.SEARCH.DATA_TYPES.CHAT; let autocompleteID: string | undefined = reportForContextualSearch.reportID; - if (reportForContextualSearch.isPolicyExpenseChat) { - roomType = CONST.SEARCH.DATA_TYPES.EXPENSE; - if (reportForContextualSearch.policyID) { - autocompleteID = reportForContextualSearch.policyID; - } else { - autocompleteID = ''; - } - } - if (reportForContextualSearch.isInvoiceRoom) { roomType = CONST.SEARCH.DATA_TYPES.INVOICE; const report = reportForContextualSearch as SearchOption; @@ -133,7 +124,11 @@ function SearchRouter({onRouterClose, shouldHideInputCaret}: SearchRouterProps) } if (reportForContextualSearch.isPolicyExpenseChat) { roomType = CONST.SEARCH.DATA_TYPES.EXPENSE; - autocompleteID = reportForContextualSearch.policyID; + if (reportForContextualSearch.policyID) { + autocompleteID = reportForContextualSearch.policyID; + } else { + autocompleteID = ''; + } } return [