mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-11 08:55:23 +03:00
publish: sort inclusive of accented characters
Alphabetical and reverse alphabetical sort in the sidebar now uses localeCompare instead of Unicode point comparison.
This commit is contained in:
parent
bee7f67d45
commit
e9c2f47729
@ -61,13 +61,9 @@ export class Sidebar extends Component {
|
|||||||
notebooks = new Map(
|
notebooks = new Map(
|
||||||
[...notebooks.entries()].sort((a, b) => {
|
[...notebooks.entries()].sort((a, b) => {
|
||||||
if ((a[1]) && (b[1])) {
|
if ((a[1]) && (b[1])) {
|
||||||
if (a[1]["title"].toLowerCase() < b[1]["title"].toLowerCase()) {
|
return a[1]["title"].toLowerCase().localeCompare(
|
||||||
return -1;
|
b[1]["title"].toLowerCase()
|
||||||
}
|
);
|
||||||
if (a[1]["title"].toLowerCase() > b[1]["title"].toLowerCase()) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@ -76,13 +72,9 @@ export class Sidebar extends Component {
|
|||||||
notebooks = new Map(
|
notebooks = new Map(
|
||||||
[...notebooks.entries()].sort((a, b) => {
|
[...notebooks.entries()].sort((a, b) => {
|
||||||
if ((a[1]) && (b[1])) {
|
if ((a[1]) && (b[1])) {
|
||||||
if (a[1]["title"].toLowerCase() > b[1]["title"].toLowerCase()) {
|
return b[1]["title"].toLowerCase().localeCompare(
|
||||||
return -1;
|
a[1]["title"].toLowerCase()
|
||||||
}
|
);
|
||||||
if (a[1]["title"].toLowerCase() < b[1]["title"].toLowerCase()) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user