Fixed: (UI) Regain jump to character functionality for search releases

This commit is contained in:
Bogdan
2023-07-08 17:01:35 +03:00
parent a663cebada
commit bd6a37dc8c
9 changed files with 81 additions and 50 deletions

View File

@@ -1,9 +1,9 @@
export default function getIndexOfFirstCharacter(items, character) {
return items.findIndex((item) => {
const firstCharacter = item.sortTitle.charAt(0);
const firstCharacter = 'sortName' in item ? item.sortName.charAt(0) : item.sortTitle.charAt(0);
if (character === '#') {
return !isNaN(firstCharacter);
return !isNaN(Number(firstCharacter));
}
return firstCharacter === character;