Skip to content

Commit

Permalink
fix: remove saved search menu item when viewing saved search
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictb committed Sep 23, 2024
1 parent 611e352 commit fa3f9f6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/pages/Search/SearchTypeMenuNarrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,22 @@ function SearchTypeMenuNarrow({typeMenuItems, activeItemIndex, queryJSON, title,
};
});

if (title && !currentSavedSearch) {
items.push({
text: title,
onSelected: closeMenu,
isSelected: !currentSavedSearch,
icon: Expensicons.Filters,
iconFill: theme.iconSuccessFill,
success: true,
containerStyle: undefined,
iconRight: Expensicons.Checkmark,
shouldShowRightIcon: false,
});
}

return items;
}, [typeMenuItems, activeItemIndex, title, theme, singleExecution]);
}, [typeMenuItems, activeItemIndex, title, theme, singleExecution, closeMenu, currentSavedSearch]);

const menuIcon = useMemo(() => (title ? Expensicons.Filters : popoverMenuItems[activeItemIndex]?.icon ?? Expensicons.Receipt), [activeItemIndex, popoverMenuItems, title]);
const menuTitle = useMemo(() => title ?? popoverMenuItems[activeItemIndex]?.text, [activeItemIndex, popoverMenuItems, title]);
Expand Down

0 comments on commit fa3f9f6

Please sign in to comment.