diff --git a/README.md b/README.md index 8d1bbc1..a641009 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,6 @@ sudo pm2 start server.cjs ### TODO - Mobile improvements -- Case insensitive sort (images, but check all) - Debounce all inputs - Update to use forms - Text formatting in background ScrollArea diff --git a/src/pages/homepage/components/Applications/Applications.tsx b/src/pages/homepage/components/Applications/Applications.tsx index e840bd2..5bf44a5 100644 --- a/src/pages/homepage/components/Applications/Applications.tsx +++ b/src/pages/homepage/components/Applications/Applications.tsx @@ -19,9 +19,9 @@ function Applications({ contentType }: { contentType: string[] }) { .sort((a: Application, b: Application) => { switch (appSort) { case 'A>Z': - return a.name > b.name ? 1 : -1; + return a.name.toLocaleLowerCase() > b.name.toLocaleLowerCase() ? 1 : -1; case 'Z>A': - return a.name < b.name ? 1 : -1; + return a.name.toLocaleLowerCase() < b.name.toLocaleLowerCase() ? 1 : -1; case 'Newest': if (a.id && b.id) { return a.id < b.id ? 1 : -1; diff --git a/src/pages/homepage/components/Bookmarks/Bookmarks.tsx b/src/pages/homepage/components/Bookmarks/Bookmarks.tsx index 73e6990..2256759 100644 --- a/src/pages/homepage/components/Bookmarks/Bookmarks.tsx +++ b/src/pages/homepage/components/Bookmarks/Bookmarks.tsx @@ -33,9 +33,15 @@ function Bookmarks({ contentType }: { contentType: string[] }) { .sort((a: BookmarkGroup, b: BookmarkGroup) => { switch (bookmarkSort) { case 'A>Z': - return a.categoryName > b.categoryName ? 1 : -1; + return a.categoryName.toLocaleLowerCase() > + b.categoryName.toLocaleLowerCase() + ? 1 + : -1; case 'Z>A': - return a.categoryName < b.categoryName ? 1 : -1; + return a.categoryName.toLocaleLowerCase() < + b.categoryName.toLocaleLowerCase() + ? 1 + : -1; case 'Newest': if (a.id && b.id) { return a.id < b.id ? 1 : -1; diff --git a/src/pages/homepage/components/Search/components/RecommendedApplications.tsx b/src/pages/homepage/components/Search/components/RecommendedApplications.tsx index a4da7f0..90697c1 100644 --- a/src/pages/homepage/components/Search/components/RecommendedApplications.tsx +++ b/src/pages/homepage/components/Search/components/RecommendedApplications.tsx @@ -51,7 +51,7 @@ export default function RecommendedApplications({ linksActive={true} /> )) - .toSorted((a: any, b: any) => (a.key > b.key ? 1 : -1)) + .toSorted((a: any, b: any) => (a.name > b.name ? 1 : -1)) .slice(0, 5)} diff --git a/src/pages/homepage/components/Search/components/RecommendedBookmarks.tsx b/src/pages/homepage/components/Search/components/RecommendedBookmarks.tsx index f34bd47..4f33b70 100644 --- a/src/pages/homepage/components/Search/components/RecommendedBookmarks.tsx +++ b/src/pages/homepage/components/Search/components/RecommendedBookmarks.tsx @@ -61,7 +61,7 @@ export default function RecommendedBookmarks({ {bookmark.name} )) - .toSorted((a: any, b: any) => (a.key > b.key ? 1 : -1)) + .toSorted((a: any, b: any) => (a.name > b.name ? 1 : -1)) .slice(0, 5)} )) - .toSorted((a: any, b: any) => (a.key > b.key ? 1 : -1)) + .toSorted((a: any, b: any) => (a.name > b.name ? 1 : -1)) .slice(5, 10)} diff --git a/src/pages/settings/components/Bookmarks/DebouncedBookmarkItem.tsx b/src/pages/settings/components/Bookmarks/DebouncedBookmarkItem.tsx index 29b4e99..e691785 100644 --- a/src/pages/settings/components/Bookmarks/DebouncedBookmarkItem.tsx +++ b/src/pages/settings/components/Bookmarks/DebouncedBookmarkItem.tsx @@ -43,7 +43,8 @@ function DebouncedBookmarkItem({ if (groupData) { setGroups( groupData.sort( - (a: BookmarkGroup, b: BookmarkGroup) => a.categoryName > b.categoryName, + (a: BookmarkGroup, b: BookmarkGroup) => + a.categoryName.toLocaleLowerCase() > b.categoryName.toLocaleLowerCase(), ), ); } diff --git a/src/pages/settings/components/Theming/ThemePlaylists/ThemePlaylists.tsx b/src/pages/settings/components/Theming/ThemePlaylists/ThemePlaylists.tsx index e8d10b9..d93a354 100644 --- a/src/pages/settings/components/Theming/ThemePlaylists/ThemePlaylists.tsx +++ b/src/pages/settings/components/Theming/ThemePlaylists/ThemePlaylists.tsx @@ -257,7 +257,7 @@ export function ThemePlaylists() { {themePlaylists .filter((playlist: ThemePlaylist) => playlist.default === 0) .sort((a: ThemePlaylist, b: ThemePlaylist) => - a.name > b.name ? 1 : -1, + a.name.toLocaleLowerCase() > b.name.toLocaleLowerCase() ? 1 : -1, ) .map((cardPlaylist: ThemePlaylist) => { return ( diff --git a/src/pages/settings/components/Theming/Themes/Themes.tsx b/src/pages/settings/components/Theming/Themes/Themes.tsx index d6cfa45..2e3ab54 100644 --- a/src/pages/settings/components/Theming/Themes/Themes.tsx +++ b/src/pages/settings/components/Theming/Themes/Themes.tsx @@ -77,7 +77,10 @@ export function Themes() { useEffect(() => { if (backgroundData && isBackgroundFetched) { - setBackgroundList(['None', ...backgroundData]); + setBackgroundList([ + 'None', + ...backgroundData.sort((a: string, b: string) => a.localeCompare(b)), + ]); } }, [backgroundData, isBackgroundFetched]);