Skip to content

Commit

Permalink
Sort favourites alphabetically (#2965) (#3283)
Browse files Browse the repository at this point in the history
Sort favourites alphabetically (##2965)
  • Loading branch information
sluedecke authored Dec 8, 2023
1 parent e926517 commit 957846c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/frontend/screens/Library/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,11 @@ export default React.memo(function Library(): JSX.Element {
if (favouriteAppNames.includes(game.app_name)) tempArray.push(game)
})
}
return tempArray
return tempArray.sort((a, b) => {
const gameA = a.title.toUpperCase().replace('THE ', '')
const gameB = b.title.toUpperCase().replace('THE ', '')
return gameA.localeCompare(gameB)
})
}, [showFavourites, showFavouritesLibrary, favouriteGames, epic, gog, amazon])

const favouritesIds = useMemo(() => {
Expand Down

0 comments on commit 957846c

Please sign in to comment.