forked from CringeStudios/gamja
Sort lists with localeCompare
The difference in case sensitivity is the most obvious change with servers like soju that support CASEMAPPING ascii and rfc1459. Currently the list: 'Alpha', 'aardvark', 'Charlie', 'comma' currently sorts to: 'Alpha', 'Charlie', 'aardvark', 'comma' with this change it will instead become: 'aardvark', 'Alpha', 'Charlie', 'comma' If something like RFC 7613 gets broader support then there are a few more differences for a list like: 'éclair', 'ecstatic, 'aardvark', 'zed', 'Gamma' currently sorts to: 'Gamma', 'aardvark', 'ecstatic', 'zed', 'éclair' with this patch would instead sort to: 'aardvark', 'éclair', 'ecstatic', 'Gamma', 'zed' The above examples were run with a locale unspecified which fell back to my browser/host default of 'en'.
This commit is contained in:
parent
a2d2a11d44
commit
096fcbf829
@ -101,7 +101,7 @@ function sortMembers(a, b) {
|
||||
return i - j;
|
||||
}
|
||||
|
||||
return nickA < nickB ? -1 : 1;
|
||||
return nickA.localeCompare(nickB);
|
||||
}
|
||||
|
||||
export default class MemberList extends Component {
|
||||
|
Loading…
x
Reference in New Issue
Block a user