diff --git a/src/hooks/friends/useFriends.ts b/src/hooks/friends/useFriends.ts index 05437b2a..68666500 100644 --- a/src/hooks/friends/useFriends.ts +++ b/src/hooks/friends/useFriends.ts @@ -16,14 +16,7 @@ const useFriendsState = () => { const onlineFriends = friends.filter(friend => friend.online); - onlineFriends.sort((a, b) => - { - if( a.name < b.name ) return -1; - - if( a.name > b.name ) return 1; - - return 0; - }); + onlineFriends.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())); return onlineFriends; }, [ friends ]); @@ -32,14 +25,7 @@ const useFriendsState = () => { const offlineFriends = friends.filter(friend => !friend.online); - offlineFriends.sort((a, b) => - { - if( a.name < b.name ) return -1; - - if( a.name > b.name ) return 1; - - return 0; - }); + offlineFriends.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())); return offlineFriends; }, [ friends ]);