Skip to content

Commit 7c1c389

Browse files
committed
Simplify Group by option builder
1 parent 4162027 commit 7c1c389

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/libs/SearchUIUtils.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3994,14 +3994,10 @@ function getGroupByOptions(translate: LocalizedTranslate) {
39943994
}
39953995

39963996
function getGroupBySections(translate: LocalizedTranslate): GroupBySection[] {
3997-
const groupByOptions = getGroupByOptions(translate);
3998-
const optionsByValue = new Map(groupByOptions.map((option) => [option.value, option]));
3999-
const getOption = (groupBy: SearchGroupBy): SingleSelectItem<SearchGroupBy> =>
4000-
optionsByValue.get(groupBy) ?? {
4001-
text: translate(`search.filters.groupBy.${groupBy}`),
4002-
value: groupBy,
4003-
};
4004-
3997+
const getOption = (groupBy: SearchGroupBy): SingleSelectItem<SearchGroupBy> => ({
3998+
text: translate(`search.filters.groupBy.${groupBy}`),
3999+
value: groupBy,
4000+
});
40054001
return [
40064002
{
40074003
options: [getOption(CONST.SEARCH.GROUP_BY.FROM), getOption(CONST.SEARCH.GROUP_BY.CARD)],

0 commit comments

Comments
 (0)