Skip to content

Commit 957846c

Browse files
authored
Sort favourites alphabetically (#2965) (#3283)
Sort favourites alphabetically (##2965)
1 parent e926517 commit 957846c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/frontend/screens/Library/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,11 @@ export default React.memo(function Library(): JSX.Element {
316316
if (favouriteAppNames.includes(game.app_name)) tempArray.push(game)
317317
})
318318
}
319-
return tempArray
319+
return tempArray.sort((a, b) => {
320+
const gameA = a.title.toUpperCase().replace('THE ', '')
321+
const gameB = b.title.toUpperCase().replace('THE ', '')
322+
return gameA.localeCompare(gameB)
323+
})
320324
}, [showFavourites, showFavouritesLibrary, favouriteGames, epic, gog, amazon])
321325

322326
const favouritesIds = useMemo(() => {

0 commit comments

Comments
 (0)