From b1a4debb95602ed0ff9129f5684fd7b9730778a1 Mon Sep 17 00:00:00 2001 From: Athou Date: Mon, 8 Jan 2024 13:48:27 +0100 Subject: [PATCH] replace toSorted usage with sort (#1183) --- commafeed-client/src/components/content/add/CategorySelect.tsx | 2 +- commafeed-client/src/components/sidebar/TreeSearch.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commafeed-client/src/components/content/add/CategorySelect.tsx b/commafeed-client/src/components/content/add/CategorySelect.tsx index cbe789f4..73492bb1 100644 --- a/commafeed-client/src/components/content/add/CategorySelect.tsx +++ b/commafeed-client/src/components/content/add/CategorySelect.tsx @@ -39,7 +39,7 @@ export function CategorySelect(props: CategorySelectProps) { label: categoryLabel(c), value: c.id, })) - .toSorted((c1, c2) => c1.label.localeCompare(c2.label)) + .sort((c1, c2) => c1.label.localeCompare(c2.label)) if (props.withAll) { selectData?.unshift({ label: t`All`, diff --git a/commafeed-client/src/components/sidebar/TreeSearch.tsx b/commafeed-client/src/components/sidebar/TreeSearch.tsx index 8d1835f8..72368c6b 100644 --- a/commafeed-client/src/components/sidebar/TreeSearch.tsx +++ b/commafeed-client/src/components/sidebar/TreeSearch.tsx @@ -16,13 +16,13 @@ export function TreeSearch(props: TreeSearchProps) { const dispatch = useAppDispatch() const actions: SpotlightActionData[] = props.feeds - .toSorted((f1, f2) => f1.name.localeCompare(f2.name)) .map(f => ({ id: `${f.id}`, label: f.name, leftSection: , onClick: async () => await dispatch(redirectToFeed(f.id)), })) + .sort((f1, f2) => f1.label.localeCompare(f2.label)) const searchIcon = const rightSection = (