biomed2
This commit is contained in:
parent
7623f719a5
commit
c2b56ed745
|
@ -45,7 +45,7 @@ export const AllAuthors = (props: Props) => {
|
||||||
let sortedAuthors = [...(props.authors || authorsSorted())] // Clone the array to avoid mutating the original
|
let sortedAuthors = [...(props.authors || authorsSorted())] // Clone the array to avoid mutating the original
|
||||||
console.log('Before Sorting:', sortedAuthors.slice(0, 5)) // Log the first 5 authors for comparison
|
console.log('Before Sorting:', sortedAuthors.slice(0, 5)) // Log the first 5 authors for comparison
|
||||||
if (searchParams.by === 'name') {
|
if (searchParams.by === 'name') {
|
||||||
sortedAuthors = sortedAuthors.sort((a, b) => a.name.localeCompare(b.name))
|
sortedAuthors = sortedAuthors.sort((a, b) => (a.name||'').localeCompare(b.name||''))
|
||||||
console.log('Sorted by Name:', sortedAuthors.slice(0, 5))
|
console.log('Sorted by Name:', sortedAuthors.slice(0, 5))
|
||||||
} else if (searchParams.by === 'shouts') {
|
} else if (searchParams.by === 'shouts') {
|
||||||
sortedAuthors = sortedAuthors.sort((a, b) => (b.stat?.shouts || 0) - (a.stat?.shouts || 0))
|
sortedAuthors = sortedAuthors.sort((a, b) => (b.stat?.shouts || 0) - (a.stat?.shouts || 0))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user