Skip to content

Commit

Permalink
Fixed weird destination options when options are less than the threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1206agra committed Jan 7, 2025
1 parent ed00cdc commit 6c34373
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libs/PerDiemRequestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ function getDestinationListSections({
const selectedOptionRateID = selectedOptions.map((selectedOption) => selectedOption.rateID);

if (sortedDestinations.length < CONST.STANDARD_LIST_ITEM_LIMIT) {
const data = getDestinationOptionTree(sortedDestinations);
const filteredNonSelectedDestinations = sortedDestinations.filter(({rateID}) => !selectedOptionRateID.includes(rateID));
if (filteredNonSelectedDestinations.length === 0) {
return destinationSections;
}
const data = getDestinationOptionTree(filteredNonSelectedDestinations);
destinationSections.push({
// "All" section when items amount less than the threshold
title: '',
Expand Down

0 comments on commit 6c34373

Please sign in to comment.