From 19feb0c48bdbe85db0f5f40a1a1d3358b5e04237 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sun, 7 Feb 2021 13:02:58 +0000 Subject: [PATCH] Desktop: Sort plugin config sections alphabetically --- packages/app-desktop/gui/ConfigScreen/Sidebar.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/app-desktop/gui/ConfigScreen/Sidebar.tsx b/packages/app-desktop/gui/ConfigScreen/Sidebar.tsx index 94a9f3e7d..b1cd98eeb 100644 --- a/packages/app-desktop/gui/ConfigScreen/Sidebar.tsx +++ b/packages/app-desktop/gui/ConfigScreen/Sidebar.tsx @@ -78,6 +78,10 @@ export default function Sidebar(props: Props) { if (s1 === SettingSectionSource.Default && s2 === SettingSectionSource.Default) return props.sections.indexOf(s1) - props.sections.indexOf(s2); if (s1 === SettingSectionSource.Default && s2 === SettingSectionSource.Plugin) return -1; if (s1 === SettingSectionSource.Plugin && s2 === SettingSectionSource.Default) return +1; + + const l1 = Setting.sectionNameToLabel(a.name); + const l2 = Setting.sectionNameToLabel(b.name); + if (s1 === SettingSectionSource.Plugin && s2 === SettingSectionSource.Plugin) return l1.toLowerCase() < l2.toLowerCase() ? -1 : +1; return 0; }); return output;