From 566b3009b61d9488cd8afe676ec0c4b3d745c6a0 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 30 Jan 2022 22:10:30 +0100 Subject: [PATCH] feat: sort tags alphabetically (#1818) Signed-off-by: Philip Molares --- .../history-page/history-toolbar/tag-selection-input.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/history-page/history-toolbar/tag-selection-input.tsx b/src/components/history-page/history-toolbar/tag-selection-input.tsx index 79253a101..2f69b5a6a 100644 --- a/src/components/history-page/history-toolbar/tag-selection-input.tsx +++ b/src/components/history-page/history-toolbar/tag-selection-input.tsx @@ -20,7 +20,10 @@ export const TagSelectionInput: React.FC = () => { const historyEntries = useApplicationState((state) => state.history) const tags = useMemo(() => { - const allTags = historyEntries.map((entry) => entry.tags).flat() + const allTags = historyEntries + .map((entry) => entry.tags) + .flat() + .sort((first, second) => first.toLowerCase().localeCompare(second.toLowerCase())) return Array.from(new Set(allTags)) }, [historyEntries])