From 064679c05719e7bf236fe579acec4c7a3dc10bb9 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 31 Aug 2024 14:59:42 -0500 Subject: [PATCH] Update:Author number of books sort fallsback to sort on name when num books is the same --- client/pages/library/_library/authors/index.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/pages/library/_library/authors/index.vue b/client/pages/library/_library/authors/index.vue index 75e9f083..9820fbce 100644 --- a/client/pages/library/_library/authors/index.vue +++ b/client/pages/library/_library/authors/index.vue @@ -61,6 +61,8 @@ export default { const bDesc = this.authorSortDesc ? -1 : 1 return this.authors.sort((a, b) => { if (typeof a[sortProp] === 'number' && typeof b[sortProp] === 'number') { + // Fallback to name sort if equal + if (a[sortProp] === b[sortProp]) return a.name.localeCompare(b.name, undefined, { sensitivity: 'base' }) * bDesc return a[sortProp] > b[sortProp] ? bDesc : -bDesc } return a[sortProp]?.localeCompare(b[sortProp], undefined, { sensitivity: 'base' }) * bDesc