From fb3086d5149434eee0b97beee9e02293251fff2a Mon Sep 17 00:00:00 2001 From: janrembold Date: Tue, 25 Jun 2024 12:02:36 +0200 Subject: [PATCH] feat: sort topics in registration by long title --- .../registration/topicSelection/TopicSelection.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/extensions/components/registration/topicSelection/TopicSelection.tsx b/src/extensions/components/registration/topicSelection/TopicSelection.tsx index f40221e5c..f7cfeab7e 100644 --- a/src/extensions/components/registration/topicSelection/TopicSelection.tsx +++ b/src/extensions/components/registration/topicSelection/TopicSelection.tsx @@ -274,13 +274,11 @@ export const TopicSelection: VFC<{ {topicGroup.topicIds .map((t) => getTopic(t)) .filter(Boolean) - .sort((a, b) => { - if (a.name === b.name) - return 0; - return a.name < b.name - ? -1 - : 1; - }) + .sort((a, b) => + a.titles.long.localeCompare( + b.titles.long + ) + ) .map((topic, index) => (