Skip to content

Commit 56f9ee2

Browse files
authored
feat: sort theme and dropdown options case-insensitively (#23)
* feat: sort theme and dropdown options case-insensitively * refactor: simplify options sorting logic * fix(colors): sort theme options
1 parent f2f828b commit 56f9ee2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib/data/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const fetchColorScheme = async (theme: string) => {
118118

119119
fetchThemeFiles().then((themeFiles: ThemeResponse[] | null) => {
120120
if (!themeFiles) return;
121-
const themeNames = themeFiles.map((file: ThemeResponse) => file.name);
121+
const themeNames = themeFiles.map((file: ThemeResponse) => file.name).sort((a, b) => a.localeCompare(b, undefined, {sensitivity: "base", numeric: true}));
122122
const themeSetting = settings.find(p => p.id === "colors")?.groups.find(g => g.id === "general")?.settings.find(s => s.type === "theme");
123123
themeSetting?.options.push(...themeNames);
124124
});

0 commit comments

Comments
 (0)