1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Sort plugin config sections alphabetically

This commit is contained in:
Laurent Cozic 2021-02-07 13:02:58 +00:00
parent 6dcb145732
commit 19feb0c48b

View File

@ -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;