Skip to content

Commit aa4b6bb

Browse files
committed
avoid nested option when menuItems is 1
1 parent 8a76cf6 commit aa4b6bb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/hooks/useSearchBulkActions.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,14 +1052,19 @@ function useSearchBulkActions({queryJSON}: UseSearchBulkActionsParams) {
10521052
return exportOptions;
10531053
};
10541054

1055+
const subMenuItems = getExportOptions();
1056+
if(subMenuItems.length === 1) {
1057+
return subMenuItems;
1058+
}
1059+
10551060
const exportButtonOption: DropdownOption<SearchHeaderOptionValue> & Pick<PopoverMenuItem, 'rightIcon'> = {
10561061
icon: expensifyIcons.Export,
10571062
rightIcon: expensifyIcons.ArrowRight,
10581063
text: translate('common.export'),
10591064
backButtonText: translate('common.export'),
10601065
value: CONST.SEARCH.BULK_ACTION_TYPES.EXPORT,
10611066
shouldCloseModalOnSelect: true,
1062-
subMenuItems: getExportOptions(),
1067+
subMenuItems: subMenuItems,
10631068
};
10641069

10651070
if (areAllMatchingItemsSelected) {

0 commit comments

Comments
 (0)